Is it obligatory to spend zakat on all eight categories?
It is not obligatory; rather, it may be spent on any one of these categories (the one in which the need is greater), and it is even permissible and valid to give it to a single person. Umar (may Allah be pleased with him), Hudhayfah (may Allah be pleased with him), Ibn Abbas (may Allah be pleased with them both), Sa’id ibn Jubayr (may Allah be pleased with him), Imam al-Hasan (may Allah have mercy on him), Imam al-Nakha’i (may Allah have mercy on him), Imam Ata (may Allah have mercy on him), Imam al-Thawri (may Allah have mercy on him), Imam Abu Ubayd (may Allah have mercy on him) and others also hold this position.
[Al-Mughni, Ibn Qudamah: 128/4]
The evidence for this is the hadith in which the Prophet ﷺ said:
تو خذ من أغنياء هم فترد على فقرائهم
“Zakat will be taken from their rich and distributed among their poor.”
[Bukhari: 1395, Muslim: 19, Abu Dawud: 1548, Tirmidhi: 621]
In this hadith the Prophet ﷺ commanded that zakat be given to the poor in general, and they are only a single category of recipients.
The jurists differed on this issue.
(Shafi’i, may Allah have mercy on him) It is obligatory to spend the zakat wealth on all the categories.
(Malik, may Allah have mercy on him) It should be spent only on whichever of them is more needy and in greater need.
(Ahmad, Abu Hanifah, may Allah have mercy on them) It is permissible to spend it on any one category.
[Nayl al-Awtar: 134/3, Al-Mughni: 128/4, Al-Umm: 71/2, Nihayat al-Muhtaj: 164/6, Hilyat al-Ulama fi Ma’rifat Madhahib al-Fuqaha: 162/3, Bada’i al-Sana’i: 45/2, Al-Asl: 172/2, Al-Insaf fi Ma’rifat al-Rajih min al-Khilaf: 248/3]