It occurred to me (while urinating) that this would seem to be selected against because water is a scarce resource. Why are we constantly losing water we don't need to through urination? What is it about the chemistry of urine and the waste products eliminated that make urination necessary as opposed to eliminating them through defecation and recovering the water on the way out?
Toilets have always been a great place to think about biology, I agree $\ddot \smile$.
In short, urine contains the waste from our blood while defecation is just the stuff that we haven't digested. Kidneys are the organs responsible for draining wastes (mostly nitrogen-containing, or nitrogenous, wastes) from our blood.
You're correct that the loss of water through urination is a considerable cost for an organism (especially those living in dry environments). But the amount of water used to excrete nitrogenous wastes is negatively correlated with the energy it costs to perform this excretion. In other words, there is a trade-off between water and energy loss during nitrogen excretion. Also the question of toxicity is important.
Animals basically have three choices to excrete nitrogenous wastes:
Not only the amount of available water in the environment should be considered in order to understand why a species is ureothelic, aminothelic or uricothelic. For example, birds are uricothelic (uric acid) probably because during the development of the embryo the wastes cannot be excreted outside the egg and therefore, excreting uric acid allows to greatly decrease the toxicity of the embryo's environment.
Note: This domain is not at all my field of study and I have no reference, typically for what concerns the toxicity, water amount and energy amount. One should not take my words for granted!