Positive commandment · Mitzvat Aseh #231 of 613
To bury [the body of] an executed person on the day of his execution
לקבור הנהרג ביומו
The verse · Devarim 21:23
לֹא־תָלִין נִבְלָתוֹ עַל־הָעֵץ כִּי־קָבוֹר תִּקְבְּרֶנּוּ בַּיּוֹם הַהוּא כִּי־קִלְלַת אֱלֹהִים תָּלוּי וְלֹא תְטַמֵּא אֶת־אַדְמָתְךָ אֲשֶׁר ה׳ אֱלֹהֶיךָ נֹתֵן לְךָ נַחֲלָה
“his body shall not remain all night upon the tree, but thou shalt surely bury him that day: (for he that is hanged is accursed of God;) that thy land be not defiled, which the Lord thy God gives thee for an inheritance.”
The Rambam’s words
To bury [the body of] an executed person on the day of his execution, as [Deuteronomy 21:22] states: "For you shall surely bury him on that day."
לקבור הנהרג ביומו, שנאמר: "כי קבור תקברנו ביום ההוא" (דברים כא,כג).
Why · Sefer HaChinuch #537
To bury him on the same day, and so too all the dead
“From the roots of the commandment is that which they, may their memory be blessed, mentioned in the Mishnah in the chapter [entitled] Nigmar HaDin (Sanhedrin 46b).”
Who & when
“This commandment is practiced, concerning those killed by the court during the time when capital punishment is practiced; and concerning other Jewish dead in every place and at all times by males and by females, such that it is a commandment to bury them on the day of death.”
Where in the Mishneh Torah
Hilchot The Sanhedrin and the Penalties within Their Jurisdiction הלכות סנהדרין והעונשין המסורין להם