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?
It is probably true that toilets and other resting-ish area are always a great place to think about biology, I agree $\ddot \smile$.
Why do we urinate?
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.
Trade-off: energy cost vs water loss
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.
Three ways to excrete nitrogenous wastes
Animals basically have three choices to excrete nitrogenous wastes:
What method is most beneficial for a given individual?
The amount of energy and the availability of water are very important aspects to understand whether a species is ureotelic, aminotelic or uricotelic. Other developmental constraint must considered too. For example, birds are uricotelic (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. In short we must consider
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!
As I have already mentioned in my other post, the most important role of urea synthesis by humans is blood pH regulation and urine concentration, so it is not just about excreting a waste product. I don't think human body is very special in this case, so I think most of the urea excreting mammals use urea for the same purposes.
The urea is created from NH4+ and HCO3- in the liver (mostly) and the kidney because of blood pH regulation purposes. It neutralizes the HCO3- created by the lungs from CO2 and OH -.
The kidney reabsorbs urea in order to concentrate the urine