Throughout history and across cultures, the regulation of sexuality reflects broader cultural norms.
Most of the history of sexuality is unrecorded. Even recorded norms do not always shed full light on actual practices, as it is sometimes the case that historical accounts are written by foreigners with cryptic political agendas.
Throughout Hindu and Vedic texts there are many descriptions of saints, demigods, and even the Supreme Lord transcending gender norms and manifesting multiple combinations of sex and gender. There are several instances in ancient Indian epic poetry of same sex depictions and unions by gods and goddesses. There are several stories of depicting love between same sexes especially among kings and queens. Kamasutra, the ancient Indiann treatise on love talks about feelings for same sexes. Transsexuals are also venerated e.g. Lord Vishnu as Mohini and Lord Shiva as Ardhanarishwara (which means half woman).
In feudal Japan, homosexuality was recognized, between equals (bi-do), in terms of pederasty (wakashudo), and in terms of prostitution. The Samurai period was one in which homosexuality was seen as particularly positive. In Japan, the younger partner in a pederastic relationship was expected to make the first move; the opposite was true in ancient Greece. Homosexuality was later briefly criminalized due to Westernization.
The berdache two-spirit class in some Native American tribes are examples of ways in which some cultures integrated homosexuals into their society by viewing them, not with the homosexual and heterosexual dichotomy of most of the modern world, but as twin beings, possessing aspects of both sexes.
The ancient Law of Moses (the Torah) forbids men lying with men (intercourse) in Leviticus 18 and gives a story of attempted homosexual rape in Genesis in the story of Sodom and Gomorrah, the cities being soon destroyed after that. The death penalty was prescribed.
Similar prohibitions are found across Indo-European cultures in Lex Scantinia in Ancient Rome and nith in protohistoric Germanic culture, or the Middle Assyrian Law Codes dating 1075 BC.
Laws prohibiting homosexuality were also passed in communist China. (The People's Republic of China neither adopted an Abrahamic religion nor was colonized, except for Hong Kong and Macau which were colonized with Victorian era social mores and maintain separate legal system from the rest of the PRC.) Homosexuality was not decriminalized there until 1997. Prior to 1997, homosexual in mainland China was found guilty included in a general definition under the vague vocabulary of hooliganism, there are no specifically anti-homosexual laws.
In modern times eight countries have no official heterosexist discrimination. They are Argentina, Belgium, Iceland, Netherlands, Norway, Sweden, South Africa, and Spain. This full non-discrimination includes the rights of marriage and adoption. Two additional countries have marriage rights for same-sex couples, namely Portugal and Canada, but in Portugal this right does not include same-sex adoption, and in Canada it varies by jurisdiction (it is legal everywhere except in Nunavut and Yukon). The Canadian Blood Services’ policy indefinitely defers any man who has sex with another man, even once, since 1977. LGBT people in the US face different laws for certain medical procedures than other groups. For example, gay men have been prohibited from giving blood since 1983, and George W. Bush's FDA guidelines barred them from being sperm donors as of 2005, even though all donated sperm is screened for sexually-transmitted diseases.