There’s no denying it, we can’t stand excrement. But why? To find out, we need to see which animals share our disgust, and which ones do the exact opposite.

Humans, as a rule, hate poo. Our love for our children generally outweighs our aversion to their bodily waste, but nobody actually enjoys changing a dirty nappy. At baby showers in the US, a game involving eating chocolate from clean, unused nappies still thoroughly grosses participants out. Many species share our aversion to faeces, however others actively seek it out – a finding that highlights the evolutionary logic beneath our apparently visceral reactions to waste.

Disgust, according to Charles Darwin, is one of the six most basic, universal emotions. The facial expression of it, which by some measures is recognisable across cultures, involves the wrinkling of the nose combined with a frown. This outward expression is accompanied by inner physiological changes like lowered blood pressure, reduced skin conductance and nausea.

Before the advent of indoor plumbing, we did our business in holes, structures and facilities entirely separate from our living spaces to avoid the stuff. Our aversion to waste even extends to the waste of other species: dog owners who fail to clean up after their dogs can face hefty fines.

Ours is not the only species that goes out of its way to avoid exposure to disgusting things like excrement, and for good reason. Psychologist Paul Rozin, of the University of Pennsylvania, argues that our disgust response reduces the likelihood of ingesting disease-causing microorganisms in decayed meat, faeces, vomit, or blood. It may even help keep us away from others who may be infected or diseased. In his book How the Mind Works, US psychologist Steven Pinker writes that disgust may reflect an intuitive understanding of microbiology. "Since germs are transmissible by contact, it is not surprising that something that touches a yucky substance is itself forever yucky," he says.

It's not just us. Some other species also quite sensibly prefer foraging for food far from where they defecate. Cows, for example, do not just graze randomly. By avoiding areas contaminated with faeces, they gobble up far fewer parasitic lungworm larvae. The same is true for sheep. Researchers at the University of Aberdeen, UK showed in experiments how sheep overwhelmingly preferred plots uncontaminated with faeces to those containing it. They were unable to distinguish between faeces infected with parasites and uninfected faeces, and so operated according to an "avoid all the poo" rule. Horses leave the parts of their fields where they eliminate ungrazed as well. Wild reindeer also selectively forage in uncontaminated areas, as do many primates.

But not all species explicitly avoid contact with yuck-inducing substances. In fact, some actually seem to seek out faeces. Patrick Walsh and Amy Pederson from the University of Edinburgh, UK, together with Erin McCreless from the University of California, Santa Cruz, noticed that the related wild white-footed mouse (Peromyscus leucopus) and deer mouse (Peromyscus maniculatus) re-inhabit the burrows of previous occupiers that contain both food and faeces.

Turd fans

The researchers conducted three different experiments to see whether the mice truly prefer being near the smelly stuff. Their first finding was that, like sheep, they could not distinguish between the droppings of parasitised and healthy mice. But the second finding was a complete surprise: the mice were more likely to choose to spend their time in an enclosure containing faeces than in a clean one. When given a choice, they preferred cotton previously used by other mice to unused cotton for nest-building. Perhaps most surprising the mice even preferred parasitised cotton balls to clean ones.

These preferences also applied to their foraging behaviour. The mice were no less likely to eat seeds that were found near faecal material – whether infected or not – than to eat seeds that were clean.

In a way, the mice were the opposite of the sheep. Neither animal could distinguish parasitised from healthy droppings, yet sheep responded by playing it safe, while the mice took a gamble. The crucial question is why? At first glance, their actions might seem like a bad idea, given the high costs of becoming infected.

What is really interesting is that domesticated rodents, such as mice and rats bred for laboratory use or for the pet trade, do avoid faeces. As wild reindeer and primates also avoid faeces, domestication isn’t the key, so what is it?

Walsh and colleagues believe that for their wild mice, the presence of faeces from other mice at a potential nesting location or near food suggests safety from predators. When the wrong move could land you between the teeth of a bigger animal, perhaps the risk of infection from faecal matter is the lesser of two concerns.

Laboratory animals, pets, and livestock are generally at a much lower risk from predators than their wild counterparts, so they can be more selective in their foraging and nesting behaviours. Every animal, the researchers argue, must calculate the trade-off between dodging parasites and surviving another day.

When you look at it this way, our faecal avoidance is something of a luxury. Perhaps our species' lack of natural predators means we are lucky to be able to afford to be disgusted by faeces and other disgusting things. Knowing this may give you a better understanding of your reaction next time you encounter a dirty nappy or some dog waste on the sole of your shoe. It probably won't make them smell of roses though.

If you would like to comment on this article or anything else you have seen on Future, head over to our Facebook page or message us on Twitter.