Evolution.
Our ancestors, when threatened by vicious animals or neighboring tribes, became stressed. That stress served a defensive function, aiding their ability to fight or simply to run away. But that wasn't enough when faced with bigger, faster animals or larger, better organized tribes.
Luckily our ancestors evolved the ability to defecate as soon as they became stressed. This provided them with an important defensive advantage in combat, allowing them to use their own feces as a weapon by flinging it at their attackers. They could also use their feces to intimidate opponents by smearing it all over themselves. The pre-historic men who were unable to defecate on the spot were killed off and, consequently, unable to pass their non-pooping-stress genes on to us.
Some of our ancestors then evolved the ability to urinate as soon as they became stressed, giving, at least our male-ancestors, a long-range weapon they could aim at opponents. From that point, it wouldn't be long until the Earth belonged to Man.