The fact that the Bible allows – perhaps at times even encourages – the death penalty for violating its most serious transgressions is based on the belief that death is not the end of a human’s existence. While it may mark one’s physical end and the demise of the body, the soul of all, including the executed, can still live on. Only with this notion can we understand the moments leading up to the execution of one condemned to die by the court.
“When he was approximately 10 cubits (15 feet) from the place of stoning they would say to him: Confess! For the way of the executed is to confess, for whomever confesses has a share in the world to come” (Sanhedrin 43b). While one may do something so terrible that one’s life is forfeit, that is only so in this world. But by confessing their sin, by doing teshuva, even at this late moment, the executed are allowed entry to the next world – that world for which the one we occupy is merely an entryway.
While it may be hard for us to grasp such an idea, the death penalty is a relatively minor punishment when compared to losing one’s portion in the world to come. As the Rambam explains in the first chapter of Hilchot Teshuva, every sin – both of omission and commission—needs some form of atonement. Such comes in various ways—by ceasing to sin, through the atonement achieved on Yom Kippur, through some form of suffering and, for the very severe sins, through death. But with atonement achieved, one is welcome in the world to come.
A fate worse than death and the loss of temporal life is losing one’s share in the world to come – the loss of eternal life. For such sins – habitually embarrassing people in public, distancing oneself from the Jewish community, or denying the existence of the world to come, to name three examples – there is little purpose to giving a death penalty as that, in and of itself, will not bring one to the world to come. In other words, strange as it sounds—and so hard for us, rooted in this world, to appreciate—the death penalty, in addition to punishing evil, is a way to “rehabilitate” the sinner.
This idea is explicitly stated in regard to the punishment of makkot, lashes, where our Sages (Makkot 23a) bring biblical support to the notion that the receiving of lashes frees one from excision, a much harsher punishment than lashes. One of the primary reasons for the 16th century attempt to reestablish a Sanhedrin was to enable many Marranos who had publically converted to Christianity and wanted to return to a full Jewish life to receive lashes from a duly constituted Sanhedrin, sparing them more severe punishment from heaven.
Allowing those about to be executed to confess, and thereby enter the world to come, is perhaps applicable only if one murders another Jew. Should one murder a non-Jew, the chilul Hashem, the desecration of the name of G-d, is so great that death by a human court does not allow for atonement. Thus, the Meshech Chochmah (Shemot 21:14) explains that there is no death penalty when a Jew kills a non-Jew. Far from being a leniency, this is a great stringency brought about by the terrible and irreparable desecration of G-d’s name that the murder of a non-Jew by a Jew brings.
At the same time, we can reach higher levels of kiddush Hashem, sanctification of the name of G-d, when interacting with non-Jews than is possible if dealing with Jews only. The Meshech Chochmah refers to the beautiful story of Shimon ben Shetach to illustrate this point.
The Jerusalem Talmud (Bava Metzia 8:1) relates how Shimon ben Shetach purchased a donkey “as is” (he was quite poor, and needed the donkey to help in his menial labour) from a heathen. His students, in surveying the animal, excitedly told Shimon ben Shetach that he was now a rich man, as the donkey contained a jewel. Shimon ben Shetach immediately responded, "Do you think I am a barbarian? I bought a donkey, not a jewel; go and return it to the Ishmaelite". Upon his doing so, the Ishmaelite exclaimed, "Blessed is the G-d of the Jewish people!"
Yet despite the “benefits” of the death penalty, our Sages did all they could to ensure that it was not actually implemented. The conditions to be met to inflict a death penalty were most onerous, and the rabbis actually looked to trip up the witnesses so that they could dismiss their evidence. Rabbi Akiva went so far as to declare that had he been on the Sanhedrin, no one would ever have received the death penalty. Rabbi Akiva need not have worried, as even 40 years before the destruction of the Temple, the rabbis had already disbanded the Sanhedrin, avoiding any need to give a death penalty.
While in heaven, the death penalty may serve a long-term benefit, here on earth our perspective is different. And being that “Torah is not in heaven”, we try to avoid the death penalty as much as possible. Just as we allow our attribute of mercy to overpower our attribute of justice, we hope that G-d, too, will find other means to allow for atonement besides a court inflicted death penalty. G-d does not need man to bring about the atonement of sinners. It is man who needs G-d to “return to us, so that we may return to Him and ‘renew our days as old’”.
 The Mishna speaks only of verbal confession and not teshuva, repentance. While absent teshuva, confession is meaningless, our rabbis preferred to speak in verifiable actions. Only G-d can ever know if a person truly has repented from sin. All a human court can ask is that we go through the motions of teshuva, and hope that such is sincere.
 The subtitle to Rabbi Maurice Lamm’s classic work, The Jewish Way in Death and Mourning, is, most appropriately, Death is a Night that lies between two days.