It looks like you're new here. If you want to get involved, click one of these buttons!
The Pali literature basically states that there are obstructions or impedments (antarayika dhamma) to obtaining liberation—sexual intercourse being one of them. In AN 4.159, for example, Ananda explains to a bhikkhuni, who is apparently sick, that sexual intercourse is to be abandoned in the practice of the holy life. Incidentally, the background to this story details that the bhikkhuni in question was faking her illness so that Ananda would come to see her. She was very infatuated with him, and when he realized this, he gave her this particular discourse. Another example can be found at the beginning of MN 22. Here, the Buddha rebukes a monk for his views regarding sex. While not explicitly stated in the sutta itself, the commentary to the sutta mentions that the wrong view of the offending monk, Arittha, dealt specifically with the first parajika training rule against sexual intercourse. The note given to this section of the sutta concerning "obstructions" by Nyanaponika Thera explains this in more detail. Simply put, for a monastic who is dedicated fully to the holy life, it is a serious hindrance to their practice. After all, the duty of the noble disciple is to discern the allures and drawbacks of, and escape from, sensuality, physical form, and feeling (MN 13).
Essentially, if you look to the Buddha's teachings, there is nothing skillful in giving in to sensual desires—including sexual ones. As lay-followers, we are not required to remain celibate; however, sex and masturbation do nothing for spiritual awakening. While it might be true that acting on these desires temporarily relieves the symptoms associated with them (lust, agitation, et cetera), and that they are natural to the human condition, Buddhism does not encourage the casual fulfillment of our sensual desires—it encourages their eventual abandonment. This is especially true in regard to sexual lust because it is one of the ten fetters (samyojana), i.e., one of the bonds that keep beings trapped in the endless round of rebirth. If you are interested in a slightly more detailed look at the link between craving and sexuality, and what the Buddha had to say concerning sexual practices in relation to awakening, please read Buddhist Sexual Ethics - A Rejoinder. I would just like to add that this should not be taken as an absolute rejection of sex as it mainly pertains to monastics who have gone forth; nevertheless, it does go to show that sexual practices are ultimately a hindrance to awakening for those of us that are interested in pursuing the path the very end of suffering.