The Prophet ﷺ gave a sermon one day and mentioned a man from among his companions who had passed away, been shrouded in an inadequate burial cloth, and buried at night. The Prophet ﷺ forbade burying a person at night before the funeral prayer had been performed over him, unless someone was compelled to do so by necessity. The Prophet ﷺ said, "When one of you shrouds his brother, let him shroud him well."
إن النبي ﷺ خطب يوما فذكر رجلا من أصحابه قبض فكفن في كفن غير طائل، وقبر ليلا فزجر النبي ﷺ أن يقبر الرجل بالليل حتى يصلي عليه، إلا أن يضطر إنسان إلى ذلك. وقال النبي ﷺ: إذا كفن أحدكم أخاه فليحسن كفنه.
Muslim narrated it in the Book of Funerals (943) through several chains from Hajjaj bin Muhammad, who said, Ibn Jurayj said, Abu Zubayr told me that he heard Jabir bin Abdullah narrate that the Prophet ﷺ gave a sermon one day, and he related the hadith in similar fashion.His saying, "not proper" means poor, not fully covering. And his saying, "the Prophet ﷺ forbade burying a man at night" is understood by the scholars to refer to the man mentioned in the story, because he had missed the Prophet's prayer over him. Otherwise, the majority hold that it is permissible to bury the deceased at night, and Abu Bakr was indeed buried at night. Those who disliked burial at night held this view because fewer people would be present to pray over the deceased, since people tend to stay in their homes at night.