The most explicit statement concerning the ancient Egyptian attitude towards sexual behavior refers not to the act itself, but to the circumstances, and is given by Herodotus: "The Egyptians were the first to make it matter of religious observance not to have intercourse with women in temples nor to enter a temple without washing after being with a woman" - The translation is that of A. D. Godley, Loeb Classical Library..
A temple was a place where physical parity was the rule, at least for those allowed to go beyond the forecourt (only priests and high officials were allowed to do so). That intercourse makes a man impure and unfit to enter a holy place is well known in Islam, and it is undoubtedly the same isea that lies behind the ancient prohibition. That some women were allowed to be present with men in the ancient Egyptian temples is evident from Herodotus' remark, and if those with whom a man might have intercourse were ordinary ancient Egyptian women coming from outside it is not easy to imagine the circumstances, unless they were prostitutes seeking their clientele in the crown. It is far more likely that members of the female staff of the temples are meant, though whether tetmple prostitutes existed, as elsewhere in the Near East, in ancient Greece, and in India, cannot be ascertained on the basis of the available material, which is practically non-existent. Herodotus has another important observation in I, 182, namely that the woman who slept in the temple at Thebes had no intercourse with men. The woman in question was undoubtedly the hmt ntr, the "god's wife". The Egyptian gods, particularly the ithyphallic Amun, also had a harim consisting of hnrwt, but there is no indication that these women ever had intercourse with anyone in this function.
That intercourse in holy places was considered unseemly at a much earlier date appears from the text of the Book of the Dead, where the negative confession includes a statement that "I did not fornicate in the sacred places of the god of my town" - ms. Amenophis III Book of the Dead.
The ancient Egyptians knew that pregnancy resulted from intercourse, or rather from the introduction of semen into the woman's body, whether through the vagina, the anus, the mouth, or the ear. (H. Grapow, Anatomie und Physiologie)
Procreation was a necessity of life, but the existence of various contraceptives suggests that this was not the only purose of the act. That iw as also performed for pleasure is evident from many literary references, and from the fact that one of the words used was ndmndm, though mostly when a god was involved.
As far as extra-material intercourse and adultery are concerned, there is universal condemnation, except for a reference to the king in the Pyramid Texts. The result was fatal to the woman, and only in the Late Period could she escape by being divorced. Men were advised against it, just as they were also recommended to abstain from relations with prostitutes. The disaster into which a man can be led by women who want money in exchange for their favors is described in the story of Setne.