The Lord spoke to Moses, saying, 2 “Say to the people of Israel…13 If a man lies with a male as with a woman, both of them have committed an abomination; they shall surely be put to death; their blood is upon them (Lev 20:1-2,13).
i) The death penalty for sodomy is controversial. Unbelievers often use this as a wedge tactic. But just because a Bible verse is "offensive" doesn't mean we should discount it.
ii) Notice, though, how the section is introduced. On the one hand, the fact that Lev 20 is specifically addressed to the "people of Israel" doesn't ipso facto rule out a wider application. Ancient Israel had a penal code because it was a nation state. Every nation state requires a penal code. And that will include laws covering sex crime, violent crime, and property crime. There's a "general equity" principle in the Mosaic law.
iii) On the other hand, the fact that Lev 20 is specifically directed at Israelites removes any presumption that these laws apply to gentiles or Christians. It's unwarranted to automatically extrapolate these laws to a completely different socioreligious context.
iv) There's also a distinction between sins and crimes. Not every sin is a crime. There are many sins the Mosaic code doesn't criminalize. Conversely, the purity codes aren't about intrinsically right or wrong conduct, but symbolic holiness.
v) Apropos (iv), it may well be that some death penalties are due to the need to keep Eretz Israel sacrosanct. In the Mosaic code, you have a category for defiling the land. There were sacred places. And there were concentric degrees of cultic holiness. The tabernacle was holier than Eretz Israel, while the inner sanctum was holier than the sanctuary.
However, even in the OT context, it wouldn't be possible to profane the land outside Eretz Israel, because the land outside of Eretz Israel was already profane. Even though sodomy was and remains a grave sin, it cannot desecrate the land, and hence, it isn't necessary to execute offenders to reconsecrate the land (e.g. pagan Egypt, Assyria, Babylon). Moreover, the purity codes and the notion of holy places doesn't carry over into the new covenant.
vi) That doesn't rule out the death penalty in some cases (e.g. murder). That antedates the Mosaic covenant, and its grounded in the imago Dei.