Peter Pett's Commentary on the Bible
Deuteronomy 21:22,23
Disposal Of Bodies Which Are Accursed (Deuteronomy 21:22).
The thought of the stoning of a son who was worthy of death leads on to the question of what was done with the body of such a person.
Analysis using the words of Moses:
a And if a man has committed a sin worthy of death, and he be put to death, and you hang him on a tree (Deuteronomy 21:22).
b His body shall not remain all night on the tree (Deuteronomy 21:23 a).
b But you shall surely bury him the same day (Deuteronomy 21:23 b).
a For he who is hanged is accursed of God, that you defile not your land which Yahweh your God gives you for an inheritance (Deuteronomy 21:23 c).
Note that in ‘a' the man is executed and hung and in the parallel he is accursed of God because he has been executed and hung which is why he must not be allowed to remain there overnight. In ‘b' his body must not remain on the tree all night, but in the parallel must be moved the same day.
‘ And if a man has committed a sin worthy of death, and he be put to death, and you hang him on a tree, his body shall not remain all night on the tree, but you shall surely bury him the same day, for he who is hanged is accursed of God, that you defile not your land which Yahweh your God gives you for an inheritance.'
It is clear from this that the practise with executed criminals was to display the body on a tree. By this it would be made apparent to the whole society that this man had been tried, sentenced, and executed. Such a man was necessarily under a curse (compare Deuteronomy 27:15). It brought shame on him and his family.
But his body must not remain on the tree all night. He must be buried the same day because he was under God's curse and to leave a cursed body there through the night would be to defile the land. It would be to extend into the next day the necessary execution of the criminal which should all be finished with on the day of execution. The execution had as it were cancelled out the criminal behaviour. The two went together, excusing and explaining the death of the criminal so that it did not defile the land.
But to leave the body hanging exposed on the tree would be to leave it with nothing to set against it on the morrow, the death thus defiling the land (compare Numbers 35:33). And to defile the land which Yahweh had given them as an inheritance was unthinkable. There was in this an element of mercy. Sufficient unto a day is the evil thereof.
It need hardly be said that in a hot country the corpse would rapidly putrefy. This too might have been seen as part of the defilement. The hanging of criminals to public exposure was a common practise. (Compare Genesis 40:19; Numbers 25:4; Joshua 8:29; Joshua 10:26; 1 Samuel 31:10; 2Sa 4:12; 2 Samuel 21:8; Esther 2:23). It is also mentioned in the Law Code of Hammurabi.
Paul took this fact and applied it to the death of Jesus on our behalf. By hanging on a tree He willingly became a curse for us thus bearing for us the curse of sin (Galatians 3:10).