The trouble with sex, from an evolutionary perspective, is that it's expensive. Not just in terms of the efforts a sexually-reproducing organism has to go through to secure a mate; every offspring produced by sexual reproduction bears half the genome of each of its parents, compared to an asexual offspring, which bears a complete copy of its only parent's genome. So, in terms of natural selection, an asexual critter gains twice as much reproductive fitness for each offspring it produces -- asexual critters should overrun sexual competitors.
helps to separate useful genes from damaging ones [PDF], making sexual offspring more fit, on average. A different (but not mutually exclusive) possibility is that by mixing up genomes, sex can help generate the genetic variation necessary for a population to evolve in response to environmental stress. This might explain a discovery reported in this month's issue of Evolution: that stressful conditions trigger the normally hermaphroditic nematode Caenorhabditis elegans to begin reproducing sexually [$-a].
The study's authors subjected three experimental lineages of C. elegans to stress -- starvation -- triggering the worms to produce semi-dormant larvae called "dauer." They then relieved the stress by transferring the population to a new food source. Some experimental treatments were kept well-fed after one period of dauer; others were repeatedly starved. Two of the three experimental lines responded to repeated episodes of dauer by producing male offspring instead of hermaphrodites.
Some of this effect was due to males' better ability to survive dauer state than hermaphrodites. A large portion was because hermaphrodites became more likely to mate with males (with a possibility to produce male offspring) following dauer, though. This kind of facultative sex takes the best of asexual and sexual reproduction -- the twofold fitness benefit of asexual reproduction most of the time; and the improved response to natural selection associated with sex in stressful conditions, when it's needed most.
Keightley, P., & Otto, S. (2006). Interference among deleterious mutations favours sex and recombination in finite populations Nature, 443 (7107), 89-92 DOI: 10.1038/nature05049
Morran, L., Cappy, B., Anderson, J., & Phillips, P. (2009). Sexual partners for the stressed: Facultative outcrossing in the self-fertilizing nematode Caenohabditis elegans.
Evolution, 63 (6), 1473-82 DOI: 10.1111/j.1558-5646.2009.00652.x