The laws in question are: “Thou shalt not lie with mankind, as with womankind: it is abomination.” (Leviticus 18:22); and, “If a man also lie with mankind, as he lieth with a woman, both of them have committed an abomination: they shall surely be put to death; their blood shall be upon them.” (Deuteronomy 20:13).
The Mosaic Law is commonly divided up into three types – moral, judicial, and ceremonial.
Moral laws are those principles that apply to all men in all places at all times. For example, “thou shalt not kill” (Exodus 20:13). It doesn’t matter who you are, where you live, or what time period you live in, murder is wrong.
Judicial laws are those laws that were in effect during the existence of the theocracy of Israel, to regulate day-to-day behavior. There is always a foundational moral principle underlying these laws, but the specifics of them applied to that nation at that time. For example, “If a man shall steal an ox, or a sheep, and kill it, or sell it; he shall restore five oxen for an ox, and four sheep for a sheep.” (Exodus 22:1). Once the theocracy of Israel ceased to exist, the judicial law ceased to be in force. The moral principles underneath the judicial law, however, are still just as valid as they always have been.
Ceremonial laws are those laws that applied to the religious worship of God in Israel. These laws also always have a foundational moral principle undergirding them. The ceremonial laws were symbolic in nature – the New Testament calls them a “shadow of good things to come” (Hebrews 10:1). Ceremonial laws ceased to be in force when Christ rent the vail in twain (Matthew 27:51) because the body (that is, the body that was casting the shadow) of all these things was Christ. When Christ came and did His work, the shadows were no longer necessary. But the spiritual and moral truths behind these laws are still valid. See also Colossians 2:13-23 and Acts 10.
The moral laws are manifestations of the very character and nature of God. They don’t change. The judicial and ceremonial laws have the moral law as their underpinnings and were put in place at a particular time for a particular reason. Specifically, they were created for the nation of Israel to separate them from the surrounding nations, to govern its civil affairs, to worship God, and to foreshadow the Messiah.
We know that the sin of homosexual behavior falls under the category of a “moral law” because it is said to be a sin multiple times in the New Testament. For example, see Romans 1:18-32. This means that it is always wrong, for all people, in all places, at all times.
People generally ask this question to try to prove a point. And the point is, "the Mosaic Law contains lots of stuff that we don't follow anymore - why should we still follow the verse that forbids sodomy?" For example, "if it's OK to eat pork, why isn't it OK to commit sodomy?" We’ve answered this above, but we should point out that the above statement makes about as much sense as, "if it's OK to eat pork, why isn't it OK to murder?"