Sex is quite an extraordinary thing, when you consider that child birth was the most common cause of death among women at the turn of the 20th century. Women have (before the advent of modern medical technology) voluntarily had sex knowing that it was quite likely to kill them, suggesting that the urge was quite strong indeed. When asked 'why do we have sex' most people will reply
or something similar, but these do not actually address the issue of why sex exists at all. Generally we have evolved because we (or at least one of the participants) enjoy(s) it. We enjoy it because we have evolved to do so. We have evolved to enjoy sex so that we have sex.
We have evolved to enjoy sex because one of more of the genes we carry are 'enjoy sex' genes. People who carried the gene had more sex, hence had more surviving children, and hence eventually bred out those who didn't carry those genes.
Of course this does not address the question of why we have evolved to need to have sex to reproduce. This answer lies in Selfish Gene Theory.