Now, we may squirm in our seats when we think about capital punishment and all the ways that people die under a capital sentence, but God's Word clearly mandates the use of capital punishment in the pages of Scripture. It is for various sins and crimes. You might be surprised about what things actually get the death penalty in the Bible. But the idea of a death penalty actually occurs as early as Genesis 9:6 where God tells Moses, "Whoever sheds man's blood, by man his blood shall be shed; for in the image of God He made man." So the idea here is that because God made man in His image, the human life is sacred, it is sacrosanct. But when one takes the life of a person who is made in God's image, a punishment in kind is deserved. And so we have the life for life, eye for an eye, tooth for a tooth principle and it comes clearly from this sort of command.
Now, God did not give this power just to anyone. He put that power in the hands of governments in their administration of justice for their particular area of jurisdiction. If you want, you can go look that up. Paul explains it in Romans 13:4. That says that God put those authorities there to do His wrath, people who sin or commit crimes worthy of it. That is put into the hands of the government. You could also see verifying scriptures in I Peter 2:12-14 where Peter says essentially the same thing.
On the other hand, He frequently forbids personal retaliation or vengeance. So He does not allow individual people to take it in mind that they are going to kill somebody for a certain crime. It is always given to a government to do it, it is given to the state to do it. So there is a clear distinction there between what a state could do or a government can do and what an individual can do. If an individual feels like a certain person is worthy of death, he has to take it to the state, make an accusation, and then the state takes it from there and the wheels of justice begin rolling.
What God advocates in here in this law is what we would call a humanitarian ethic. Remember, we just read back in Genesis 9 that a person—man, woman, child, does not matter—is made in God's image. And so we should have respect for their lives and for their bodies and that we should not leave dead bodies hanging around even if we want to deter other crime and sin. God says, put that body in the ground. It is over, the man did his evil deed, you had the deterrent, now it is done, it is finished, it is over. The punishment has been made. The penalty has been paid, get him in the ground. Move on.