In the Buddha's first discourse, he identifies craving (tanha) as the cause of suffering (dukkha). He then identifies three objects of craving: the craving for existence; the craving for non-existence and the craving for sense pleasures (kama). Kama is identified as one of five hindrances to the attainment of jhana according to the Buddha's teaching. Throughout the Sutta Pitaka the Buddha often compares sexual pleasure to arrows or darts. So in the Kama Sutta (4.1) from the Sutta Nipata the Buddha explains that craving sexual pleasure is a cause of suffering.

The Buddha then goes on to say:

The 'flood' refers to the deluge of human suffering. The 'far shore' is nirvana, a state in which there is no sensual desire.

The meaning of the Kama Sutta is that sensual desire, like any habitual sense pleasure, brings suffering. To lay people the Buddha advised that they should at least avoid sexual misconduct (See Theravada definition below). From the Buddha's full-time disciples, the ordained monks and nuns, strict celibacy (called brahmacarya) had always been required.

Overview
Former Vice President of the Buddhist Society and Chairman of the English Sangha Trust, Maurice Walshe, wrote an essay called 'Buddhism and Sex' in which he presented Buddha's essential teaching on human sexuality and its relationship to the goal (nibbana). The third of the five precepts states:

Kamesu micchacara veramani sikkhapadam samadiyami,

The literal meaning of this statement is, "I undertake the course of training in refraining from wrong-doing in respect of sensuality." Walshe comments,

The Buddha's teaching arises out of a wish for others to be free from dukkha. According to the doctrine he taught, freedom from suffering involves freedom from sexual desires and the training (Pali: sikkha) to get rid of the craving involves to a great extent abstaining from those desires.

Monastic Buddhism
Apart from certain schools in Japan and Tibet, most who choose to practice Buddhism as ordained monks and nuns, also choose to live in celibacy.

Mainstream views
Sex is seen as a serious monastic transgression. Within Theravada Buddhism there are four principal transgressions which entail expulsion from the monastic Sangha: sex, theft, murder, and falsely boasting of superhuman perfections. Sexual misconduct for monks and nuns includes masturbation. In the case of monasticism, abstaining completely from sex is seen as a necessity in order to reach enlightenment. The Buddha's criticism of a monk who broke his celibate vows—without having disrobed first—is as follows:

Japanese Buddhism

Conversely to most tenets of Buddhism, Japanese Buddhist monks were strongly associated to the partaking of pleasure and sexual relationships. Many of them were known to maintain relationships with prostitutes and geishas, often maintaining long term liaisons with them. While those aspects were a popular target of criticism and satire as charge of moral corruption, both "by Japanese who often were ideologically hostile to Buddhism themselves or by Western observers inclined to view Buddhism as an obstacle to Christian missionary success in Japan", as well as other orthodox Buddhists, some adherents to this lifestyle sometimes claimed it to be actually part of their religious practice. As such, there were currents of local esoteric Buddhism, possibly influenced by non-Buddhist folk tradition, that valued sexuality positively.

The Japanese deva Kangiten, a Buddhicized form of the Hindu god Ganesha, was considered sexually symbolic, being represented as dual figures embracing. It received a wide worship, especially among geishas and people in the business of pleasure, and its esoteric sexuality meant its image had to be usually covered from public eyes. The 12th century saw the rise of the infamous Tachikawa-ryu sect, an extreme tantric sex school where human skulls and emission of sexual fluids were used in ritual, for which they were later persecuted and suppressed by mainstream Buddhists. Finally, even in non-tantric Buddhism, influential 15th century monk Ikkyu preached for sex and love as valid ways to reach Enlightenment. He is considered both a heretic and a saint within Zen.

Lay Buddhism
The most common formulation of Buddhist ethics are the Five Precepts and the Eightfold Path, which say that one should neither be attached to nor crave sensual pleasure.  These precepts take the form of voluntary, personal undertakings, not divine mandate or instruction. The third of the Five Precepts is "To refrain from committing sexual misconduct.

Celibacy or Brahmacariya rules pertain only to the Eight precepts  or the  10 monastic precepts.

According to the Theravada traditions there are some statements attributed to Gautama Buddha on the nature of sexual misconduct. In Everyman's Ethics, a collection of four specific suttas compiled and translated by Narada Thera, it is said that adultery is one of four evils the wise will never praise. Within the Anguttara Nikaya on his teachings to Cunda the Silversmith this scope of misconduct is described: "...one has intercourse with those under the protection of father, mother, brother, sister, relatives or clan, or of their religious community; or with those promised to someone else, protected by law, and even with those betrothed with a garland" (etc.- child/underage) 

Bhikkhu Nyanamoli has provided an English Translation of the Majjhima Nikaya 41, "He is given over to misconduct in sexual desires: he has intercourse with such (women) as are protected by the mother, father, (mother and father), brother, sister, relatives, as have a husband, as entail a penalty, and also with those that are garlanded in token of betrothal."

Sexual yoga

According to some Tibetan authorities, the physical practice of sexual yoga is necessary at the highest level for the attainment of Buddhahood. The use of sexual yoga is highly regulated. It is only permitted after years of training. The physical practice of sexual yoga is and has historically been extremely rare. A great majority of Tibetans believe that the only proper practice of tantric sex is metaphorically, not physically, in rituals and during meditative visualizations. The dominant Gelug sect of Tibetan Buddhism holds that sexual yoga as an actual physical practice is the only way to attain Buddhahood in one lifetime. The founder of the sect Tsongkhapa did not, according to tradition, engage in this practice, but instead attained complete enlightenment at the moment of death, that being according to this school the nearest possible without sexual yoga. The school also taught that they are only appropriate for the most elite practitioners, who had directly realized emptiness and who had unusually strong compassion. The next largest school in Tibet, the Nyingma, holds that this is not necessary to achieve Buddhahood in one lifetime. The fourteenth Dalai Lama of the Gelug sect, holds that the practice should only be done as a visualization.

Homosexuality

Among Buddhists there is a wide diversity of opinion about homosexuality. Buddhism teaches that sensual enjoyment and desire in general, and sexual pleasure in particular, are hindrances to enlightenment, and inferior to the kinds of pleasure (see, e.g. pīti, a Pāli word often translated as "rapture") that are integral to the practice of jhāna.  The Buddha Gotama once stated, “Just as rain ruins an ill-thatched hut, passion destroys an ill-trained mind.” 

The third of the five precepts admonishes against "sexual misconduct"; however, "sexual misconduct" is a broad term, subject to interpretation according to followers' social norms. Early Buddhism appears to have been silent regarding homosexual relations.

According to the Pāli Canon and Āgama (the Early Buddhist scriptures), there is not any saying that same or opposite sex relations have anything to do with sexual misconduct, and some Theravada monks express that same-sex relations do not violate the rule to avoid sexual misconduct, which means not having sex with someone underage (thus protected by their parents or guardians), someone betrothed or married and who have taken vows of religious celibacy.

Some later traditions feature restrictions on non-vagina sex, though its situations seem involving coerced sex.

Conservative Buddhist leaders like Chan master Hsuan Hua have spoken against the act of homosexuality. Some Tibet Buddhist leaders like the 14th Dalai Lama spoke about the restrictions of how to use your sex organ to insert other's body parts based on Je Tsongkhapa's work.

The situation is different for monastics. For them, the Vinaya (code of monastic discipline) bans all sexual activity, but does so in purely physiological terms, making no moral distinctions among the many possible forms of intercourse.

See also
Buddhist ethics
Religion and sexuality
Tachikawa-ryu
 Buddhist view of marriage
 Buddhism and sexual orientation
 Buddhism and romantic relationships

References

Bibliography

Further reading

External links

Buddhist Sexual Ethics: Main Issues – Alexander Berzin
Buddhist & Western Views on Sex – Alexander Berzin
Thinking through Texts: Toward a Critical Buddhist Theology of Sexuality by José Ignacio Cabezón, Public Lecture, Naropa University, September 23, 2008