Hajj is not obligatory except on those who are able to perform it. This includes physical and financial ability. Therefore, Hajj is not obligatory on a person who is in debt. However, if a person has a long-term loan and he is required to pay only a certain amount each month, then his debt is only that which is due each month. If he pays off all the debt and then nothing is left with him to make Hajj, then Hajj is not obligatory on him. But if he pays the monthly dues and then has enough money to make Hajj, then he should make Hajj because it obligatory on him.
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
“Hajj is obligatory only on those who can afford it both financially and physically. It is crucial that the fare and provisions for this sacred journey be solely derived from lawful earnings, totally free of unlawful sources; it is equally important that they be free of all outstanding debts. Since you have accumulated arrears of student loans that are outstanding, you are not allowed to undertake the trip to Hajj. Your first priority is to pay your debtors. Hajj is fard (obligatory) only if you have enough resources remaining after paying them. So you should not consider Hajj unless you have come clean on your record of payment.
The Prophet (peace and blessings be upon him) has warned us against performing acts of worship with tainted resources. We read in the Hadith: “Verily, Allah, the most Exalted, is Pure and He accepts only that which is pure; Verily, Allah commands the faithful with the same order He commands the apostles: ‘O Messengers! Eat of what is clearly halal and wholesome, and do good works.’” Then he mentioned (by way of illustration) the case of a man, who undertakes, after having traveled long distances, with disheveled appearance, and then raises his hands in supplication saying, ‘My Lord! My Lord!’ while his food comes from unlawful sources and his drink comes from unlawful sources, his clothes are from unlawful sources, and his entire body is nurtured by haram; so how would Allah answer his Prayer?” (Reported by Muslim on the authority of Abu Hurayrah).”