Praise be to Allah.
The categories of people to whom zakaah may be given are those which Allah, may He be exalted, listed in the Qur’an. Whoever gives his zakaah to any other category, it is not acceptable and he must give his zakaah again, giving it to one of the categories specified in sharee‘ah.
For more information on these categories, please see question no. 46209.
Building hospitals and equipping them them does not fall into one of the categories of zakaah.
It is very difficult for the one who gives zakaah to a hospital to be certain that it will be spent in the manner prescribed. It might be spent on equipping or expanding the hospital, or purchasing equipment for it, or on salaries and bonuses for those who work there, or on buying medicine to be given to all the patients, both poor and rich, Muslim and non-Muslim.
It is well-known that simply being sick does not make a person entitled to receive zakaah; rather he must also be poor or in need (that is, in need of money because he does not have sufficient money to meet his needs), or he must be in debt to the hospital for his medical treatment, in which case he may be given zakaah in order to pay off the debt he owes.
In addition to that, he must also be Muslim.
Giving zakaah to a hospital is not without problems, and the one who gives it cannot be certain that he has given his zakaah to a cause that is prescribed by Islamic teaching.
The scholars of the Standing Committee for Issuing Fatwas were asked the following question:
Attached is a copy of a letter from the King Faisal Specialist Hospital, about their request for help for the hospital’s charitable fund, which was set up to help the needy and poor who are unable to afford the costs of medical treatment and staying in the city of Riyadh; this refers to patients and those accompanying them, who come from all parts of the Kingdom. Do you think that it is permissible to give zakaah to this fund? Please advise us, may Allah reward you with good and make all our deeds sincerely for His sake alone.
We do not think that it is permissible to give zakaah to such funds, because hospitals are not among the categories of people to whom zakaah may be given, as stated in Islamic teachings, and one cannot be sure that it will be spent in the prescribed manner.
And Allah is the source of strength; May Allah send blessings and peace upon our Prophet Muhammad and his family and companions.
Standing Committee for Academic Research and Issuing Fatwas
Shaykh ‘Abd al-‘Azeez ibn ‘Abdillah ibn Baaz; Shaykh ‘Abdullah ibn Qa‘ood; Shaykh ‘Abdullah ibn Ghadyaan.
Fataawa al-Lajnah ad-Daa’imah (9/437, 438).
Even though this question was about a fund that would be only for the poor and needy, in most cases one cannot be sure of their poverty and need, because they are people who are unknown to the one who is giving zakaah and to those who are in charge of the fund. So it is not possible to be entirely certain that the zakaah will be given to one of the categories of people who are entitled to it. So it is better to refrain from giving zakaah as a donation to a hospital. This is in general terms.
If the one who is giving his zakaah does not feel comfortable about giving his zakaah to any cause other than this, then the Islamic solution in this case is for him to go to the hospital, and see the patients for himself, and look for someone who is in need and examine his situation, then give the zakaah directly to him, or to his family, if they are the ones who are spending on his treatment.
And Allah knows best.