In the United States, as per a survey in 2010, the majority still favours the death penalty for murder. This means that the majority of people who read this post, at least those from the United States, should agree that the death penalty itself is appropriate for certain crimes. So it's not so much the fact that God commanded the death penalty that people sometimes get upset about, but rather it's the choice of crimes which are punishable by death that people disagree with according to modern moral standards. In the Bible God gave laws to the nation of Israel, through Moses. For many who haven't read the Bible, their knowledge of the content and nature of these laws is often misinformed, and some people seem to think that any and every infraction was subject to the death penalty. But this is not so. Of the various offences which were punishable by death, first degree murder was one of them; and as we've seen, the majority of Americans approve of this one. Most others fall into one of two broad categories; religious sins and sexual sins. You could be put to death for worshipping one of the pagan gods, such as Baal or Molech, or for corrupting the true religion through false prophecy. Also for various sexual sins like adultery, incest or prostitution. Essentially all of the capital crimes are crimes which affect relationships between people or the relationship between us and God. This reflects God’s values. Imparting these values to mankind is what a loving God desires to do. Things like theft or vandalism, which primarily affect things rather than relationships, are not worthy of the death penalty. If you Google a comprehensive list of the capital crimes according to Moses, like this one, you’ll see that each of them falls into one of these two major categories.
When we disapprove of the death penalty for something like adultery, which in today's society is no crime at all, we are judging this ancient society by our own moral reasoning. Or typically less than that; we often haven't done any reasoning, but because such a penalty is unthinkable in our society, we simply deem it inappropriate for the ancient Israelites as well without giving it any thought at all. But if we think for a moment what our attitude might be like if we were an ancient Israelite, and someone said to us that “at some point in the distant future, adulterers won't get so much as a fine,” we would be aghast! “But in such a society as that, every second person you meet would probably be an adulterer!” Well, after a Google search on “adultery statistics”, I discovered that this is a fairly accurate guess; roughly 50% of married men cheat on their wife. So at least half of my readers know, or will know, the pain of what that's like; and probably all of us will at least know someone who has suffered because of infidelity. And it doesn't just affect the husband or the wife, but also the children very deeply. Why don't we consider it to be a greater offence than we seem to? Well, maybe some are nodding their head a little, but will then say, “Sure, adultery isn't right, but I still don't wish my cheating husband or wife were dead!” Why does God command so harsh a penalty for adultery? All of these capital crimes tell us about what God values as important. When we don’t see marriage, for example, as important enough to protect with so strong a deterrent as the death penalty, we need to realise that this is a problem with our view of the world, not with God’s.
The reason for the death penalty for any crime is typically a deterrent. Another crime punishable by death in the Bible is what we might call “contempt of court”. That is, if you disobey the decision of the legal system. Again, contrary to the belief of some, there was a legal system; you couldn't just kill your neighbour and then tell everybody “Uh... I caught him worshipping Baal.” Deuteronomy 17 makes it clear that it must be proven beyond doubt that the offense of idolatry was committed, and says “On the evidence of two witnesses or of three witnesses the one who is to die shall be put to death; a person shall not be put to death on the evidence of one witness. The hand of the witnesses shall be first against him to put him to death, and afterward the hand of all the people. So you shall purge the evil from your midst.” (Deuteronomy 17:6-7). And in the case of contempt of court, when a person is put to death, it says “And all the people shall hear and fear and not act presumptuously again.” (Deuteronomy 17:13). So the various crimes punishable by death are those which God particularly wants to deter. Idolatry we can understand from that perspective; the great division of mankind is whether we worship the one true God or not. All of the “religious crimes” punishable by death are serious because of how serious it is to worship the wrong god. And since God uses marriage as an illustration of man's relationship to God where God is the “husband”, we are the “wife”, and idols are those we “fornicate” with; so adultery and other forms of fornication are similar offences to idolatry. But perhaps we should be wondering why God is picking some sins over others as “more serious” at all, because all sin is serious in God's eyes and worthy of death; even of eternity in hell. Well, this is right; it is in fact a demonstration of God's grace and mercy that not all offences were punishable by death. But God has placed this sort of emphasis on crimes which affect interpersonal relationships, and our relationship with God. As Jesus also emphasised explicitly when He said:
And he said to him, “You shall love the Lord your God with all your heart and with all your soul and with all your mind. This is the great and first commandment. And a second is like it: You shall love your neighbor as yourself. On these two commandments depend all the Law and the Prophets.” (Matthew 22:37-40)