ANSWER: The Bible does not wait long before mentioning the death penalty for certain sinful actions. In Genesis, soon after Noah left the ark, but many years before the giving of the law at Mount Sinai, we find God instructing humans on punishing those who willfully murder another person. It is the first time the Eternal tells humans it is their duty to carry out the penalty of death, as a society, against those who take the life of an innocent person.
Whoever sheds man's blood, his blood shall be shed by man (the death penalty) - for He made man in the image of God (Genesis 9:6, HBFV throughout).
Ancient Israel, according to Biblical law, had a multitude of offenses that came with the penalty of death. Under the old covenant, the "church" and the state were united. The duty of the government was to enforce the laws of the Torah against those who violated them.
Bible examples of those worthy of the penalty of death include anyone who encourages people to worship gods other than the true One of Israel (Deuteronomy 13:5 - 15).
Anyone who worked on the seventh day Sabbath was also executed (Exodus 31:14, 35:2). Those who practiced the "black arts" (e.g. Mediums) and those who indulged in certain sexual sins could also count on being put to death as the ultimate penalty for their disobedience (Leviticus 20:6, 10 - 18, 27).
Since the end of the old covenant system (Hebrews 8:6 - 8, 13, 9:9 - 10), however, there has been a separation of church and state as far as God is concerned. His way of governing, which is a combination of that which is both political and religious, will come back to the earth after Jesus' second coming.
In the meantime, as Paul states, the Eternal has chosen to use and empower human governments to maintain law and order, and to carry out capital punishment (the death penalty) where justified (Romans 13:1).
The apostle Paul wrote the book of Romans while he was a Roman citizen. The empire had, at the time, a government that formally upheld pagan, idolatrous practices. In spite of this, Christians were commanded to obey Rome's laws so long as it did not tell them to violate God's will (cf. Acts 5:29). The Romans were empowered to impose the penalty of death for certain crimes (verses 3 - 4). Human governments today also possess the same basic right.
According to the Bible, the penalty of death does deter others from committing capital offenses. God's instruction on how to handle those convicted of leading people away from him states, "And you shall stone him with stones (punish the person with death) so that he dies because he has sought to drive you away from the Lord your God . . . And all Israel shall hear, and fear, and SHALL DO NO MORE any such wickedness . . ." (Deuteronomy 13:10 - 11, see also 21:21).
Secular social scientists have debated for years what kind of penalty ought to be meted out for some of the most heinous crimes committed. Those who believe in what God's word teaches, however, are duty bound to believe it when it says that death is an effective deterrent to crime. At the very least, the taking of a guilty person's life for serious crimes certainly stops THEM from carrying out more evil!
The God of the Bible believes in and teaches the proper use of the death penalty in order to punish the worst evildoers. Christians today have not been given the authority to carry out such a punishment, in part, because their primary citizenship is in heaven (Philippians 3:20). Man's governments have been given the responsibility of maintaining law and order, and punishing those who do evil, until Jesus Christ returns.