I've often pondered this myself. I personally believe we have a natural ability to taste poop, or at least to know it's bad,. Perhaps our early ancestors didn't have this ability and ate their poop, not knowing it was bad for them (similar to dogs). But due to random mutations, some of us began to develop a distaste for it. The ones with a distaste for poop were less likely to eat poop and were thus more healthy. As a result their genes were passed on more successfully and the distaste for poop became dominant. This eventually led to us finding the smell of poop to be bad as well.
It's not bad for animals to eat poop, though. Dogs may do it because they're lacking in digestive enzymes, and rabbits produce a special kind of stool that they actually have to eat or else they'll get sick.