Deuteronomy 21:22-23

22 “If someone has committed a crime worthy of death and is executed and hung on a tree, 23 the body must not remain hanging from the tree overnight. You must bury the body that same day, for anyone who is hung is cursed in the sight of God. In this way, you will prevent the defilement of the land the Lord your God is giving you as your special possession.