Even today, when death sentences are carried out in civilized countries that have a death penalty, the condemned is asked to confess and show regret for the crime that he committed.
The Mishna teaches that Jewish law strongly encourages this behavior. According to the Mishna (43b), when the condemned man was ten cubits from the place of execution the court-appointed individuals who escorted him would tell him to confess, since by doing so his execution would serve as an atonement for him and he would receive a share in the World-to-Come.
The source for this, which is discussed in detail on today’s daf, is the story of Akhan who stole from the city of Yeriḥo after it was set aside for destruction by God and Joshua (the entire contents of the conquered city was declared to be ḥerem – see Sefer Yehoshua Chapter 7). We find that Akhan clearly confesses to his crime in pasuk 20, and the Mishna concludes that his confession was accepted and served as atonement based on Yehoshua’s response in pasuk 25 where he says that God would punish him “on this day,” indicating that he would receive his portion in the World-to-Come.
By a homiletical examination of the passages that describe the process by which Akhan was found guilty, the Gemara interprets his actions to have included a wide variety of inappropriate acts, aside from stealing from the ḥerem. Rabbi Abba bar Zavda suggested that he committed adultery with a married woman; Rabbi Ile’a quoted Rabbi Yehuda bar Masparta as saying that he denied the mitzva of circumcision. Furthermore, he said that the passage listing all of the things that Akhan did (see Yehoshua 7:11) repeats five general transgressions, indicating that he violated all five books of the Torah.
The Keli Yakar suggests that since all five of the books of the Torah teach that it is forbidden to steal, clearly Akhan transgressed them all. The Ramah points to specific commandments that appear in each of the five books: circumcision in Bereshit, stealing in Shemot, taking consecrated property in Vayikra, taking that which is not his, as appears in Bamidbar and putting it among his own possessions, as appears in Devarim.