Deut 21:22-23

Miscellaneous Laws 22When someone is convicted of a crime punishable by death and is executed, and you hang him on a tree,23his corpse must not remain all night upon the tree; you shall bury him that same day, for anyone hung on a tree is under God's curse. You must not defile the land that the Lord your God is giving you for possession.