The Torah in Parashat Ki-Teseh (Debarim 21:22) commands that violators of certain capital offenses – idol-worship and blasphemy – must be hung after their execution, and then adds that the offender’s remains must be buried that same day – “Ki Kabor Tikberenu Ba’yom Ha’hu” (21:23). This establishes the Biblical command to bury a violator who was executed by Bet Din, and, by extension, all people. There is a Torah command to bring any deceased person to burial.
The Sefer Ha’hinuch explains that if a violator’s body is not hung the same day, this will cause f Hilul Hashem (defamation of G-d), as people will see the body and thus be reminded of the offense he committed. This will cause people to speak a great deal about his idol-worship or blasphemy, thus resulting in a Hilul Hashem. The Torah therefore commands bringing the body to burial that same day, before sundown.
This aspect of the Misva applies only in the times of the Bet Ha’mikdash, when courts had the authority to administer capital punishment. The extension of the Misva, of course, which applies to every deceased person, is binding in all times, in all places, and upon both men and women.
The Sefer Ha’hinuch writes that those who leave a body unburied past sundown transgress this affirmative command, as well as the prohibition of “Lo Talin Niblato” (literally, “Do not allow his corpse to remain overnight”). The Me’il Ha’efod (Rav David Pipano, Bulgaria, 1851-1924) notes the implication of the Sefer Ha’hinuch’s comment, that even the prohibition of “Lo Talin” is violated if the body is left unburied by sunset. This is in contrast to the view of some Aharonim that whereas the affirmative command of “Ki Kabor Tikberenu Ba’yom Ha’hu” is violated once the sun sets, the prohibition of “Lo Talin” is violated only if the corpse remains unburied throughout the night. Indeed, the phrase “Lo Talin” seems to forbid having the corpse remain overnight, until morning. Apparently, the Sefer Ha’hinuch followed the understanding of the Ginat Veradim (Rav Avraham Ben Mordechai Ha’levi, Egypt, 1650-1712), that “Lo Talin” refers to leaving the body unburied for even part of the night. Thus, once the body remains unburied past sunset, both the Misvat Aseh and the Misvat Lo Taaseh have been transgressed.
Importantly, the Sefer Ha’hinuch here writes that the command is violated if the body is left unburied “She’lo Li’chbodo” – “not for his [the deceased’s] honor.” The burial may be delayed if this is necessary for the deceased’s honor, such as to bring him to Eretz Yisrael for burial, or to allow time for those close to the decease to arrive from afar so they can attend the funeral.

