Me and a friend were arguing about this question: Is sex ultimately for reproduction or pleasure? I said reproduction, but he argues that you can have sex and never have a child, which would prove sex is for pleasure and children are the aftermath of a choice when having sex (to ejaculate and fertilize the egg). Is there any way to clear this up with the logic of evolution (to evolve, one must reproduce)?

It depends what you mean by "ultimate purpose". Sex and all that goes with it (the associated pleasures, the urges, the courtship-instincts) has clearly evolved because of its role in reproduction. It wouldn't exist if it didn't play this role. So if something's "ultimate purpose" is to serve that role the playing of which led evolutionarily to its existence, then, yes, sex is ultimately for reproduction. This is true, I think, even though this notion of purpose is, I take it, problematic on evolutionary grounds. One complication is that a thing (a process, a feature, a characteristic) may be a mere evolutionary by-product, and so not have a purpose in this sense. Moreover, things that evolve for one reason might start to serve new purposes, and persist and spread because of this. And finally a thing's evolutionary purpose(s) (if any) might be entirely indiscernible to us. I presume, though, that none of this applies to sex. In fact, sex is probably the only thing that I (from my armchair) feel...