Long ago I listed all the moral topics I could think of and systematially considered what they might mean in terms of human survival. I didn't know what to make of sex at the time. It's a pretty crazy topic. It seems time to address it.
A simpler minded person could probably answer this easier so why is it even a question? Sex is one of the best illustrations of when logic fails to explain morality, an organic thing. Because sex often makes us a bit irrational and often irrational stuff is dangerous to our survival. So often sex is manipulative or simply exploitive. Sex has so many dangers including diseases. Sex is about the most basic aspect of survival, reproduction, but should it be limited to that to avoid all the crazy associated with it? The thing is, sex is good for our physical and mental health. The drive to have sex isn't just essential to our physical existence. In anthropological and historical terms it seems to have been a driver of civilization. The benefits and pleasures of sex are often a side effect of civilization. In nature, sex is about reproduction. In civilization it can be far more and it probably needs to be. An Existentialist would say that humans need the reasons to live and strive that they can find. Sex is an important one, if we can get around some of the problems involved.
The first thing is to ask why is sex important. That might seem obvious but foundations are important when building ideas of fact and reason. Reporduction is called the second basis of ecology after energetics. Hey, it it's basic to ecology, it must be important. Really, in the philosophical terms of this larger story, the first reason given for why we exist and our pourpose in life is survival and in evolutionary terms that means generation after generation. That means sex. It also means powerful instincts and while humans do have some instincts to have children (seemingly stronger in some women) our real powerful reproductive instinct is to have sex. Then in the natural course of things pregancy and children follow. Also in the natural course of behavioral things, all kinds of nurturing behaviors are "released" by pregnancy and birth. Sex itself releases bonding behavior that is essential to the family structure required for the difficult and demanding task of the long developmental period of human. Yes, for the foreseeable future that I consider, the family will usually be the best mechanism for "raising" children. Pragmatically though, the dominant moral question is about who is responsible for the child that is the result of sex. All societies and most moral systems are oriented around that issue. The important behavioral driver - status, is involved too. The thing is that like so many other things, the story of sex has been changed in a fundemental way by humans and we need to both understand that and adapt to it. Everything about sex has always been predicated on the common result of it - children. Humans have developed birth control techniques though and that has changed that fundemental rule.
In evaluating sex in moral terms and trying to keep it short, the upsides can be described more briefly. As mentioned, to the Existentialist, sex can offer one of those good things in life. It can be an important part of love, the importance of which to survival is discussed elsewhere, including that it can help prevent violence and war. It is inexpensive entertainment that is good for us physically and mentally. Another way to look at it is that it is important to mental health. It is not only good exercise but can be an inspiration to good health.
Now for the long list, the potential problems. Like a lot of good things though, it can be worth the long trip to get there. Oh yes, "SEX" comes as a package deal with so much physical and emotional baggage, preconceptions, inhibitions, embarassment, clumsyness, lore and disappointment that I dare say this is pretty sure to make most people uncomfortable at some point. Sorry, but it caa be a long bumpy trip. The point of this essay is to make it easier and lay out some guide posts. Keep in mind that this topic, like the rest of this story is told in our current context and the context of humans husbanding our genetic destiny. It also needs to be told in terms that folks like John Locke would agree makes sense, social justice while being considered in terms of Sociobiology. Great... this needs to be brief.
In biological terms we have sex because that is the mechanism our genes have developed to reproduce themselves. Yeah, lets mix things up a a bit with that reminder. In terms of Sociobiology, males and females can and will be very different strategically which also means psychologically. In mammals, males can naturally, potentially, have more offspring than females. That is why they aggressively compete with each other for females. While males have something of a quantity strategy, females have more of a quality strategy because she has more limited reproductive potential and almost always has far more investment in each child. Having children is a great risk for her let alone demanding so she competes for the fittest male. All of this is the source of the drive for status and you can ask any advertising executive the power of that.