For most of recorded history, one would not have had to explain or defend this injunction. Even as recently as 30 years ago, the majority of the population would have accepted this mitzvah at face value. Today, however, sensibilities are different and this mitzvah is seen as intolerant and homophobic (as if these are traits that are relevant to ascribe to God!). While a full analysis of this topic is beyond our scope, we will do our best to address it in this limited format.
For starters, there’s no prohibition against having homosexual tendencies per se. Just as one can only get credit for refraining from cheeseburgers if one desires to eat them, one is only rewarded for abstaining from homosexual relations if one is tempted by them. Furthermore, the only act that might potentially result in capital punishment was intercourse, and then only with a warning and qualified witnesses as is the case in any mitzvah that might result in execution by the courts. (That’s not to say that homosexual activity other than intercourse is permissible under Torah law, just that only intercourse was actionable.) So there’s no general prohibition against “being gay” and there’s no mitzvah to hate or oppress such people.
What today’s society finds especially “intolerant” is (a) that homosexual relations are considered a capital crime by the Torah and (b) that the Torah calls homosexual intercourse a to’eivah (“abomination”). Let’s contextualize those two statements.
Lots of mitzvos are potentially capital offenses. These include most of the forbidden sexual relationships described earlier in this parsha, a number of which are permitted under secular law. For example, if one’s father divorced a woman, I imagine one could marry his ex-stepmother. Under Torah law, that’s a capital crime. In our society, adultery is a call for counseling; in the Torah, it’s a capital offense. Sewing a button on Shabbos or performing other simple labors would likewise be capital offenses. Homosexual intercourse is just one of many, many behaviors that were potentially subject to execution under Torah law. In all of these cases, the odds of actually being executed were pretty slim. According to the Mishna in Makkos (1:10), a Sanhedrin that carried out an execution once in 70 years was considered a “bloody court.” So, the threat of potential execution was more of a general statement as to the severity of a particular mitzvah, not a witch hunt.
As far as the term to’eivah (abomination), that’s a common Biblical term far from unique to this mitzvah. Remarrying an ex-wife who had married another man in the interim is called a to’eivah (Deuteronomy 24:4), as is selling a dog and using the money to purchase a Temple sacrifice (Deut. 23:19). Non-kosher food is likewise called a to’eivah (Deut. 14:3). So, again, this term is by no means limited to this mitzvah.
My point in mentioning all this is that, even though most people in our society drive on Friday nights (an act that is potentially a capital crime under Torah law) and most people in our culture love bacon (which is called an abomination by the Torah), nobody sees the halacha as a kind of crusade against those whose lifestyles include these things. They recognize that the Torah has a standard of behavior that people can choose to adopt or not. But for some reason, when it comes to homosexuality, they perceive the same kind of statements as a virtual fatwa against civil rights. It’s not. Yes, homosexual relations are forbidden in halacha, but no more or less so than eating on Yom Kippur or wearing clothes containing a mixture of wool and linen (shaatnez).
Now, why would God forbid such a thing? As we have stated earlier, sex in Judaism is not seen as dirty or evil but it does have a context under which it is permitted. Homosexual relations are prohibited because they are inherently incapable of producing offspring, which is the ultimate reason for the gift of sex. (We are aware that not every heterosexual relationship is capable of producing children, but in general such relationships are. It’s like saying, “Human beings have two arms and two legs.” There are exceptions, of course, but the inherent nature of people is to have that number of limbs.)
Since the Torah does not have vowels, the words in Hebrew can be read “lo sishkav,” “you shall not lie” in the active form, or “lo sishacheiv,” in the passive. This would prohibit one to participate in homosexual intercourse in either the active or the passive role. (Alternately, the passive role can be said to be prohibited by Deut. 23:18; see Talmud Sanhedrin 54b.)
This mitzvah applies in all times and places. It is discussed in the Talmud in tractate Sanhedrin on pages 54a-b. It is codified in the Shulchan Aruch in Even Ha’Ezer 24. This prohibition is #350 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos and #116 of the 194 negative mitzvos that can be fulfilled today as listed in the Sefer HaMitzvos HaKatzar of the Chofetz Chaim.