A Debt Owed to Allah —

The Prophet, peace be upon him, was asked by one of his companions whether he should offer the pilgrimage of his father who died before completing that duty. The Prophet, peace be upon him, asked him: “Had your father left some debts unpaid, would you pay them on his behalf?” When the son answered in the affirmative, the Prophet, peace be upon him, said: “A debt owed to Allah has a better claim to be paid.”

Through Zakah —

While it is permissible for a person to receive Zakah money to meet some of the expenses connected with pilgrimage, we should not forget that pilgrimage is not compulsory for the one who can’t meet all the expenses on his own.