Allaah has mentioned the things on which zakaah is to be spent in the verse (interpretation of the meaning):
“As-Sadaqaat (here it means Zakaah) are only for the Fuqaraa’ (poor), and Al-Masaakeen (the poor) and those employed to collect (the funds); and to attract the hearts of those who have been inclined (towards Islam); and to free the captives; and for those in debt; and for Allaah’s Cause (i.e. for Mujaahidoon — those fighting in a holy battle), and for the wayfarer (a traveller who is cut off from everything); a duty imposed by Allaah. And Allaah is All-Knower, All-Wise”
The scholars are agreed that the phrase “for Allaah’s Cause” refers to jihad for the sake of Allaah. But they differed as to whether Hajj is included with jihad or not.
The majority of scholars were of the view that it applies only to jihad and does not include Hajj. Imam Ahmad was of the view that it includes Hajj as well, and he quoted as evidence for that the report narrated by Abu Dawood (1988) from Umm Ma’qal, who said: “O Messenger of Allaah, I need to go for Hajj and Abu Ma’qal has a young camel.” Abu Ma’qal said, “She is telling the truth, and I shall donate it for the sake of Allaah.” The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Give it to her so that she may go for Hajj on it, for it is for the sake of Allaah.” Classed as saheeh by al-Albaani in Saheeh Abi Dawood.
And it was narrated that Ibn ‘Umar said: “Hajj comes under the heading of for Allaah’s Cause.” Al-Haafiz said: Abu ‘Ubayd narrated it with a saheeh isnaad.
See al-Mughni, 9/328; al-Majmoo’, 6/212.
Shaykh al-Islam Ibn Taymiyah said in al-Ikhtiyaaraat, 105:
Whoever has not done the obligatory Hajj and is poor should be given what he needs to do Hajj – i.e. from the zakaah funds.
And it says in Fataawa al-Lajnah al-Daa’imah, 10/38:
It is permissible to give zakaah so that poor Muslims can travel to do the obligatory Hajj, because this comes under the general meaning of the phrase “for Allaah’s Cause” in the verse which speaks of the ways in which zakaah is to be spent.
And Allaah knows best.