Abu Hurayrah (may Allah be pleased with him) reported that the Messenger of Allah (may Allah's peace and blessings be upon him) said: "Hurry up with the funeral (the dead body), for if it is righteous, you will be taking it forward to what is good; and if it is otherwise, you will be laying evil off your necks."
عن أبي هُرَيْرَةَ -رضي الله عنه- قال: قال رسول الله -صلى الله عليه وسلم-: «أَسْرِعُوا بِالْجِنَازَةِ فإنها إن تَكُ صالحة: فخير تُقَدِّمُونَهَا إليه. وإن تَكُ سِوى ذلك: فشرٌ تَضَعُونَهُ عن رِقَابِكُمْ».
شرح الحديث :
The Prophet (may Allah's peace and blessings be upon him) ordered that the dead body should be carried quickly for burial, or he probably meant that it should be prepared quickly by getting it washed, prayed over, carried, and buried. This is because if the dead person was righteous, then he would be taken quickly to a good destination and should not be delayed. We learn from another Hadīth that the dead person says: ''Take me forward. Take me forward.'' If the dead person was evil, then staying longer would be a bad thing for people, hence, the dead body should better be taken quickly to the grave.