Both religions emphasize the importance of self-control and celibacy in religious practice. However, Hinduism does not condemn sexual acts as sinful except those that are deemed deviant or socially unacceptable such as incest, rape, adultery, and unnatural sex. In Hinduism, sex is divine. It is an obligatory duty because it responsible for procreation and the orderly progression of creation. Without sex, there is no possibility of rebirth or liberation or continuation of God's eternal duties.
As with other things in creation, sex is also of three types, sattvic, rajasic and tamasic. Of these sattvic sex, which leads to pleasure and happiness, and orderliness of society, but does not lead to pain or breach the social and religious norms, is the best. Sattvic sex is dutiful and moral; rajasic sex is selfish and lustful; and tamasic sex is coercive and painful.
Sex and householders
Hence, Hinduism rightly recognizes sexual pleasure (kama) as one of the chief aims of human life. However, as with other things, sex must fit into the overall scheme of an orderly and disciplined life that leads to liberation and upholding of dharma. In other words, one must indulge in sex in the larger interests of life and existence, as part of one's duty towards God, not otherwise. While students are expected to practice celibacy until they are married, householders are allowed to indulge in sex both within marriage and in some instances outside marriage also.
In Hinduism, polygamy was an accepted practice until modern times. Men were allowed to marry multiple women. They also enjoyed the freedom to indulge in sex with willing women outside their marriage such as the maids who worked in their households or those who provided sexual pleasures for money, power, love, protection, or some other reason.
However, sex with women who were under the protection of their fathers or other male members of their families was strictly prohibited. Women were sold and bought in some parts of ancient India.
Prostitution was prevalent in ancient India and pleasing desirable men through enticing acts was considered an art. Unmarried women who chose to live freely had the privilege to sleep with the men of their choice. The story of Jabala, the mother of Satyakama, is an example in this regard.
If a widow had no children, she had the permission from the law books to choose a brother or cousin of her deceased husband for procreation. If a couple had no children for long, law books gave permission to the couples to choose a suitable person to impregnate the wife. Hindu scriptures draw a clear distinction between sex and lust. While sex is divine, lust is an evil and those who succumb to it fall down to the lowest worlds.
Sex and Hindu gods
The gods of Hinduism are pleasure loving, while the goddesses are mostly chaste and pure. The Puranas depict most of the Hindu gods as libidinous and not immune to the charms of opposite sex. They enjoy having sex with heavenly maidens and beautiful earthly women. According to the Vedas, the Puranas, and the Upanishads when a person departs from here to the immortal world, on his way thousands of maidens come forward with perfumes and garlands to greet him and entertain him. It is one of the passing pleasures of a pure soul that has attained liberation and ready to be anointed by the Lord Himself in the highest world.
Indra is as fickle as the human mind and susceptible to sexual desire. He is particularly jealous of anyone trying to practice celibacy or asceticism. If they progress far on the path, he would dispatch beautiful nymphs from heaven to entice them and disturb their austerities. Vedic gods such as Indra and Agni were often captivated by the beauty of earthly women, and even the wives of rishis. Indra ruined the reputation of many chaste women, such as Ahalya, by tempting them with his guiles and indulging in sexual conjugation with them. Among other gods, notable was Lord Krishna who had numerous wives and consorts. Even Shiva, an epitome of self-control and asceticism, fell for the beauty of Mohini, a manifestation of Lord Vishnu and legend has it that they had a child out of that engagement. Brahma, the creator god, was captivated by the beauty of Saraswathi, his own creation, and made her his consort.
Sex and Hindu ascetics
Celibacy is a central part of Hindu asceticism. Hindu ascetics are expected to shun sexual intercourse by all means as part of their spiritual transformation. Brahmacharya is one of the chief restraints. However, it is not a universal norm, because sexual intercourse is permitted in certain Hindu traditions, such as Tantra, as part of one's liberation.
Most of our ancient seers, including the seven seers, were married. They had one or more wives and had children through them. They also often enjoyed sex with other women and celestial nymphs. The progenitor of Indian people, Bharata, was born from a relationship between sage Viswamitra and the heavenly beauty Menaka, who was sent by Indra to entice him and disturb his austerity.
Satyavati, wife of Santanu, had a son named Krsna Dvaipayana, also known as Vyasa, before her marriage. She bore him through sage Parasara, who saw her alone one day, when she was ferrying passengers across a river. She had a bad body odor. Sage Parasara promised to remove her bad odor, if only she would consent to sleep with him. Afraid that he would curse her if she refused, she agreed to satisfy his lust. As promised, Parasara removed her bad body odor. A son was also born to her from that union. When Vicitravirya, her second son through her husband, Santanu, died without children, sage Vyasa helped both the widows, to conceive sons and continue the Bharata race. He also slept with one of the servant girls sent by Satyavati, to whom Vidura was born. Even the Pandavas and Kauravas were born under strange circumstances outside marriage. In the Ramayana, we have the story of Bali forcibly taking away Tara, the wife of his brother Sugriva and keeping her in his palace. When Bali was killed by Lord Rama, she returned to her husband. In the same epic, we see Rama subjecting his wife who was in captive to a fire test before accepting her chastity. Later in the story, when a commoner doubted her chastity, he banished her to forests.
Sex in the Upanishads
There are few verses in the Chandogya and Brihadaranyaka Upanishads which are explicitly sexual in nature. They suggest how a man can make a woman agreeable for sexual intercourse for procreation, by performing certain rituals and how force can be used if necessary to make the woman agree for the intercourse. They also suggest how a husband can harm the secret lover of his wife with the help of some sacrificial rituals and by invoking destructive powers. These Upanishads compare sexual intercourse to a sacrifice and the various organs used in the intercourse to the tools and materials used in the sacrifice.