There is no reason in evolution. No design intention.
So you can only enumerate a list of reason why it is useful, and specultate that the feature remained (after it appeared accidently ; after all people taste are various and random) because it helped the people who had this feature to survive more than other.
And there are a few reason why it is useful :
* There are lot of bacterias in there that are very usefull for digestion, but are not supposed at all to reach other part of your body. E. coli, for example
* Anyway, even in it were harmless, by nature, faeces is what your body could not use. So what would be the point of having your digestive system to process a second time a "food" that would be rejected again 100%, normally?
So, those 2 advantages together could be summarized by: because it is better not to eat it. And we don't eat disgusting things. And on the other end, we tend to try to eat everything else. I mean, I don't know what the guy who discovered that cow milk was good was trying to do, but apparently, he was giving a try to anything not too disgusting.
Another advantage to find faeces disgusting, is that because of that we try to stay quite far from it. And smell of our faeces is one strategy for lot of predators to locate us. So it is a good idea not to be too close of our own faeces when our predator find it.
(That is the reason why lot of animals tend to bury it. Because they don't plan to go too far, but want to avoid detection)
Now: you asked for a chemical reason. That is considering the problem backward. We have quite fine chemical sensors. We can detect plenty of different chemical products. The reason why some are disgusting and some are not is not related to the product itself. But to our own evolution. We learnt to find disgusting some and to find appealing some other.