I did some research online about homosexuality in the ancient Near East. Here's what I found:
Law codes in the ancient Near East—including those of Urukagina (2375 BC), Ur-Nammu (2100 BC), Eshnunna (1750 BC), and Hammurabi (1726 BC)—virtually ignore homosexual acts. Vern Bullough notes that these law codes had a great influence on later law codes, were intended to deal with specific deeds (not general moral principles), and seem not to have been observed in all cases or at all times. The Hittites, who flourished in eastern Anatolia (Turkey) and Syria ca. 1700-700 BC, had one law that stated, “If a man violates his son, it is a capital crime” (section 189c). The same judgment was declared on father-daughter incest and mother-son incest. As Hittitologist Harry Hoffner, Jr., observed, “a man who sodomized his son is guilty of urkel [illegal intercourse] because the partner is his son, not because they are of the same sex.” Later, he added, “[I]t would appear that homosexuality was not outlawed among the Hittites.”
Two laws from a Middle Assyrian code, from Assur (12th century BC but probably copies or extensions of earlier laws going back to at least the 15th century BC 8), also mention homosexuality. They speak of a “seignior,” someone of high social rank in the community, and his “neighbor,” someone of equal social status who lived in the vicinity. Later scholars simply view these laws as applying to any Assyrian man. Table A, paragraph 19 reads (translated by Theophile Meek): “If a seignior [an Assyrian man] started a rumor against his neighbor [another citizen living nearby] in private, saying, ‘People have lain repeatedly with him,’ or he said to him in a brawl in the presence of (other) people, ‘People have lain repeatedly with you; I will prosecute you,’ since he is not able to prosecute (him) (and) did not prosecute (him), they shall flog that seignior fifty (times) with staves (and) he shall do the work of the king for one full month; they shall castrate him [lit. ‘shall cut off’] and he shall also pay one talent of lead.” Harsh punishment was often decreed in ancient times, e.g. in this law code including death and cutting off ears, noses, lips and fingers (Cf. A,5,9,12). The meaning of igadimus (“shall cut off”) is ambiguous and has also been translated as “he shall be cut off” from the community (G.R. Driver and J.C. Miles, 1935) and “they shall cut off” his beard or hair as a form of branding (Chicago Assyrian Dictionary, gadamu, G, 8) The preceding prohibition (A,18) in this law code deals with false (or unproven) rumors spread about a man’s wife sleeping around (like a prostitute); and its wording and punishment are very similar to A,19, except there is no “cutting off” and less blows are specified. In both cases, the lord’s reputation was at stake in the face of a grave slur that had been circulated against him.
Table A, paragraph 20 deals with a physical act done, not just a rumor: “If a seignior [an Assyrian man] lay with his neighbor [another citizen], when they have prosecuted him (and) convicted him [the first citizen], they shall lie with him (and) turn him into a eunuch.” This describes a situation where a man has forced sex upon a local resident or business partner, who then has the option of bringing a charge against him. Noticeably, the perpetrator is punished while the victim is not; so the crime here is rape. Homosexuality itself is not condemned, nor looked upon as immoral or disordered. Anyone could visit a prostitute or lay with another male, as long as false rumors or forced sex were not involved with another Assyrian male. Still, both of these laws suggest that for a male to take the submissive woman’s role in same-sex intercourse was looked down upon as shameful and despised.
Pictorial and literary references in ancient Mesopotamia show acceptance of some forms of homosexuality, but wariness toward others. Anal intercourse was freely pictured in figurative art in the ancient cities of Uruk, Assur, Babylon, and Susa from the 3rd millennium BC on—and images show that it was practiced as part of religious ritual. Both Zimri-lin (king of Mari) and Hammurabi (king of Babylon) had male lovers, which the queen of Zimri-lin mentions matter-of-factly in a letter. The Almanac of Incantations contained prayers favoring on an equal basis the love of a man for a woman, of a woman for a man, and of a man for man. (Lesbian love is not mentioned, probably because of the low status of women in ancient times, when women were basically considered property, and adultery was considered a trespass against the husband’s property. A husband was free to fornicate, but a wife could be put to death for the same thing. ) The Summa alu, a manual used to predict the future, sought to do this in some cases on the basis of sexual acts, five of which are homosexual:
“If a man copulates with his equal from the rear, he becomes the leader among his peers and brothers.
If a man yearns to express his manhood while in prison and thus, like a male cult-prostitute, mating with men becomes his desire, he will experience evil.
If a man copulates with an assinnu [a male cult-prostitute], trouble will leave him (?).
If a man copulates with a gerseqqu [a male courtier, or royal attendant], worry will possess him for a whole year but will then leave him.
If a man copulates with a house-born slave, a hard destiny will befall him.”
The fact that different kinds of homoerotic pairing will occur is taken for granted. What mattered was the role and the status of a partner, especially the passive partner—and the anticipated ramifications in each case. To penetrate a male who was of equal status or a cult prostitute was thought to bring good fortune; but copulation with a royal attendant, a fellow prisoner, or a household slave was thought to probably spell trouble.
Cult prostitution, involving heterosexual and homosexual acts, was found throughout ancient Near East history. William Naphy notes how male and female prostitutes had intercourse with male worshippers in sanctuaries and temples in ancient Mesopotamia, Phoenicia, Cyprus, Corinth, Carthage, Sicily, Libya, and West Africa. Norman Sussman explains that “male and female prostitutes, serving temporarily or permanently and performing heterosexual, homosexual, oral-genital, bestial, and other forms of sexual activities, dispensed their [sexual] favors on behalf of the temple. The prostitute and the client acted as surrogates for the deities,” representing both fertility and sexuality in an erotic sense.
Mespotamian scholar Jean Bottero notes that cultures in this region considered sex “far too natural” to write about, or to boast of sexual abilities and prowess. Also, “We find not the slightest declaration of love, no effusion or sentiment or even tenderness. Such impulses of the heart … are suggested rather than openly expressed.” It was expected that everyone marry and bear children, but still men who had the economic means could take one or more ‘second wives’ or concubines. Also, they were free to visit the professional prostitutes of both sexes. In fact, Inanna/Ishtar was called a ‘hierodule’ (a divine sacred ‘prostitute’); and many male prostitutes, homosexual and transvestite, served her. Making love was a natural activity that should not be demeaned, they believed; and it could be practiced as one pleased as long as no third party was harmed or a prohibition was broken (such as the banning of sexual activity on certain days, and some women were reserved for the gods). In fact, William Naphy notes that a striking feature of the ancient Near East was “how few cultures seem to have any significant ‘moral’ concern about same-sex activities. … Most cultures seemed to accept that males might have sexual relations with other males”—although for a male to assume the passive position in intercourse (unless he was an adolescent) was thought somehow to make him less than a male thereafter. Laws only banned certain negative forms of homosexuality, namely, slander, rape and incest. Kings had male lovers along with their wives, warriors developed romantic attachments, and ordinary men customarily had anal intercourse with male and female cultic personnel. Also, the tradition of youthful rite of passage comes down from prehistoric times. Tom Horner described three types of individuals who engaged in homosexual activity in ancient Biblical times: (1) military heroes, manly types, who shared a noble love; (2) cult prostitutes, often effeminate and eunuchs, who offered themselves to worshippers at pagan shrines; and (3) average citizens, who engaged in casual same-sex relationships, even though one or both of them might have been married. (- http://epistle.us/hbarticles/neareast.html)
Based on all of that, we can see that homosexuality in the world of the ancient Near East was not totality pederastic, though that may have been a majority of it. We also see that it, along with heterosexual prostitution, was part of their pagan religious system, as it was in the days of the NT as well (notably, but not exclusively, Corinth). A third expression of homosexuality seems to have been homosexuality relationships between consenting adults by choice. According to the research, the end was not a marriage relationship, or even an enduring one, but merely another way to express one’s affections.
It is in this cultural context that Leviticus was written. In Leviticus, God is defining his own holiness and making an appeal to the holiness of those who claim his name (Lev. 11.44-45). Chapters 18-22 are written to show that because of God’s holy nature , there are many behaviors that break fellowship with Him. Homosexual behavior is one of them. It is “detestable”. Why? There is no immediate explanation, but the tenor and teachings of the Pentateuch gives us clues. The lives of God’s people are supposed to imitate and reflect the character and nature of God. If Leviticus teaches us nothing else, it teaches us that we must always be attentive to holiness, whether physical, ritual, or moral. The world, the Bible teaches, is depraved, evil, and separated from God by sin, and God’s people are to maintain distinctions between ourselves, as “holy” (separated unto God), and the sin that is in us by natures and around us by environment (2 Cor. 6.14-18.)
We are told here that homosexual behavior is a sin. It is unfair to make the text here refer only to pederasty or religious homosexuality, for neither the verse nor its context makes that point. But what makes homosexuality so abominable? We are given a few clues.
1. Our lives are supposed to reflect the character and nature of God. In Genesis 1.27 we are told that when God created “in his own image”, the result was “male and female.” Something about the differences between them, and yet them being one seem to be behind the meaning, possibly reflecting something about the Trinitarian nature of God: different, and yet one. The male and female complement each other physically, as well as spiritually, intellectually, and morally. There is something about heterosexuality and sexual differentiation that is “the image of God.” Ultimately, we do not reflect God’s image on our own, but in relationship, and that relationship is actually spelled out for us: male and female.
2. The ubiquitous image throughout Scripture of a lost relationship to God is a plethora of sexual metaphors, but primarily adultery and prostitution. Sexual “deviance” (anything other than a marriage relationship between a man and woman) is used as “Poster Boy #1” that something is wrong spiritually.
3. Paul, in Romans 1.26-27, speaks of what is “natural.” Even though women have two penetrable cavities between their legs, and men have one, it may be debatable what “natural” is. Genesis 2.24, again, lets us know that it is a man and a woman together that create a “natural” as well as “Godlike” unity.