By Avner Friedmann
The Parsha states: “If a man committed a sin the judgment of which is death, he shall be put to death and you shall hang him on a tree. His body shall not remain at night on the tree. Rather, you shall surely bury him on that day, for a hanging person is a curse of G-d and you shall not contaminate your Land, which HaShem, your G-d, gives you as an inheritance.”
A person found guilty by the court for worshiping idols or for blaspheming G-d, is executed by stoning and his body is hung after execution. This serves as a reminder of what the he did, which was a direct affront against HaShem. Nonetheless, the body must be taken down and buried before nightfall. This is because it is considered to be disgraceful to allow the body of a Jew to remain hanging. There is no other death penalty which is more accursed and shameful than this one.
Because human beings were created in the image of G-d and HaShem calls the Jewish people His children, leaving the body of a Jew hanging is regarded as being a disgrace to G-d Himself. This may be likened to a king who sees the body of his own son hanging in the public square. Since this is his son, it may be mistaken as being the king himself, so to speak. Therefore the custom is to hang the body immediately before sunset and take it down for immediate burial before dark.
Upon death the soul departs from the body and each component returns to its source, as written: “Thus the dust returns to the ground, as it was, and the spirit returns to G-d who gave it.”
The Holy Zohar enumerates three additional reasons why the body should be hung for the least amount of time and then buried immediately:
1) For the soul to ascend to its proper abode, it must be given a spiritual garment made of the mitzvot (commandments) that he fulfilled during his lifetime. The soul cannot receive this garment until the body is buried.
2) As long as the body remains unburied, the soul experiences spiritual anguish. This is because during the night the spirits of impurity become strengthened. When the G-dly soul of a Jew departs from the body, it leaves behind a spiritual “vacuum”, so to speak, which pulls in impure spiritual entities that enter the body and contaminate it.
3) Sometimes HaShem has decreed to reincarnate the soul immediately into a baby about to be born. If the body is not buried this can be delay.
Now, since the above reasons actually apply to everyone, not only blasphemers and idolaters, it is Jewish custom and Halacha (Torah Law) to make burial arrangements immediately upon a death and to make every effort not to delay the funeral as much as possible.
Before the soul descends into this physical world, it takes an oath to be righteous and not wicked. Fortunate is the person who returns a clean soul to his Maker; a soul unsoiled by transgressions and overflowing with Torah knowledge and mitzvot.
May it be HaShem’s will to bring about the true and complete redemption, speedily and may we behold the resurrection of the dead, when “death will be swallowed up forever”.
 Rashi on 21:23.
 Ecclesiastes 12:7.
 Amor 88b.
 Isaiah 25:8