Sorry, I think I typed too quickly when I posted before. It's not really clear that the endorphins are "required" for ejaculation, but they are associated with it. Ejaculation is a spinal reflex, so really doesn't require the brain at all (that can lead to a lot of good jokes, but I'll try to keep this serious). It actually seems more likely that the brain provides an inhibitory input to block this reflex, so the endorphins may be involved in dis-inhibiting the brain block of ejaculation (patients with spinal cord injury can have an ejaculation, but don't have the experience of orgasm...but you really don't want to know how the ejaculation is accomplished...you'll have nightmares). Alternatively, release of endorphins may be a consequence of the ejaculation. Many of the areas of the brain that are involved in the rewarding properties of drugs of abuse are the same as those involved in the rewarding properties of sex behavior. Obviously, we didn't evolve to abuse drugs. It is important that sex be rewarding so we continue to reproduce. So I don't really have an answer of "why" these neurotransmitters are involved in reproduction, but more that they "do" have a function, although a lot is still unknown about the specific nature of this function.
And you're asking all the tough questions, aychamo! The biggest difficulty in studying orgasm, per se, is that we're not really sure if non-human females experience orgasm, and with males, it's hard to dissociate ejaculation from all the other components of sexual behavior. Right now, I'd have to give a weasel-out type answer of just saying it's probably like other feedback systems where there's a cumulative effect of sensory stimuli that eventually surpasses a certain threshold that allows the orgasm to occur. That's not much of an answer, but it's the best I can offer. What I can offer is that there is a function to orgasm in females as well as males. Obviously, in males, it is associated with ejaculation, which is essential for insemination. In females, the vaginal and uterine contractions are thought to help guide the sperm toward the oviducts to improve fertility. In both men and women, the pleasurable feelings are important for ensuring the species continues to reproduce (how likely would we be to do it if we didn't enjoy it?).
And if you think we don't know as much as you'd hope about this, don't think it's going to get a lot better all that quickly. There's a lot of resistance to fund research in this area. Congress tried, yet again, this year to prevent NIH from funding any research on the topic of sexual behavior, regardless of scientific merit. Fortunately, scientists and scientific societies were once again able to successfully lobby to prevent this and to keep the peer-review process intact as the means of judging the merit of proposals. But those of us who study reproduction are acutely aware that we need to be very careful of how we word things in case Congress ever gets their way on this and we need to avoid certain words to prevent our funding from getting cut.