An interesting piece by Engber from Slate Magazine (The article even includes a link to a YouTube gallery on the subject!):
The recent finding that masturbation improves the quality of human sperm supports the notion that it's an evolved trait and not merely a byproduct of our physiology. According to a branch of evolutionary theory called "sperm competition" that developed in the late-1960s, natural selection can produce just such a change in reproductive behavior. The theory focuses on polyandrous species—i.e., those in which a single female takes multiple partners and the sperm from several potential fathers might end up competing to fertilize the same egg. Under those conditions, the relative quality of male ejaculate very clearly determines whose genes are passed on to the next generation.