Without sex many organisms die out, but why? Sex is not the only form of reproduction, there is also asexual reproduction, which does not require a mate. Sex is a costly and complicated exercise for any organism, so it must have some evolutionary benefit over asexual reproduction that outweighs its costs.
The difference between these form of reproduction is that in sexual reproduction the genes are always mixed up. Whereas, in asexual reproduction genes are often not mixed up, or not to as great an extent. Having gene mixing introduces more changes that could potentially be advantageous to the species as its environment changes. This accelerates the rate at which the species can adapt to survive these environmental changes.
In an environment that changes rapidly, introducing more changes, and therefore allowing for faster adaptation is key to survival. Fast changing environments can be caused by bacteria that invade other species. Such bacteria can often change quickly, so their hosts must evolve equally as fast to keep up, in a sort of arms race. If either species could not modify rapidly then they would become extinct. This is why organisms that have to cope with parasites tend to reproduce sexually, such as humans, and most animals and plants.
This principle has recently been demonstrated in the lab using round worms genetically modified to produce either sexually or asexually. The worms are introduced into an environment with a bacteria that invades their digestive system and kills them. It was shown that the worms that reproduced asexually died out quickly. Whereas, those reproducing sexually could adapt, and the population survived alongside the bacteria, while both continued to evolved.