In the answer to question no. 44039, we explained that if the deceased had some wealth, then the expenses of preparing him for burial are to be paid from his wealth. If he did not have any wealth, then his shrouding should be paid for by the one who is obliged to spend on him (such as his father or son, or a spouse). If that is not possible, then it should be paid for from the bayt al-maal (treasury). If that is not possible, then it must be paid for by the Muslims as a whole.
Based on that, it is not permissible to divert zakaah funds to pay for burial preparations for the deceased, even if they were poor.
Al-Bahooti (may Allah have mercy on him) said in Kashshaaf al-Qinaa‘ (2/271): Those who are entitled to zakaah… are eight categories and it is not permissible to give it to other causes, such as building mosques… shrouding the dead, donating Mushafs as a waqf or other charitable causes. End quote.
Ibn Qudaamah (may Allah have mercy on him) said: It is not permissible to spend it on other causes such as building mosques, repairing roads or shrouding the dead, because Allah, may He be exalted, said [in the verse on zakaah, al-Tawbah 9:60] “innama (‘only’)”, which means it is limited only to what is mentioned, and everything else is not allowed. End quote from al-Kaafi.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: This is correct, and this is a good argument, and there is no evidence for those who say that the phrase “and for Allaah’s Cause” [al-Tawbah 9:60] includes all good actions because sabeel-Allah (Allah’s cause or the way of Allah) is the way that leads to attaining His pleasure. We say: This is mistaken, firstly because Allah mentioned that in the midst of other specific things; i.e., if He had mentioned it at the end of this list, we could have said that this is a generalization after mentioning specific things, or if He had mentioned it at the beginning of this list, we could have said that this is specifying after mentioning something general. But because He mentions it in the midst of those who are entitled to zakaah, and says “and for Allaah’s Cause”, this indicates that what is meant by “and for Allaah’s Cause” is something specific, which is jihad for the sake of Allah. Moreover, if we say that “and for Allaah’s Cause” is general in meaning and includes all kinds of good deeds, then saying “only” is redundant and makes no sense. The correct view is what the author (may Allah have mercy on him) mentioned.
End quote from Sharh al-Kaafi.
And Allah knows best.