The ruling on whoever wants to perform Hajj and he owes a Debt
Question :
Is it permissible for whoever owes a debt to perform the performed it, but he wants to perform a voluntary Hajj?
Answer:
If a person owes a debt that takes up all the wealth that he has, then he is not obligated to perform Hajj, because Allâh has only made Hajj obligatory on the person who is able. Allâh said:
"And Hajj (pilgrimage to Makkah) to the House (the Ka'bah) is a duty that mankind owes to Allah, those who can find a way there."
Whoever owes a debt that takes up all of what he has, then he is not able to go for Hajj. Based upon this, he should repay the debt. Then, if it is easy for him after that, he should perform Hajj. However, if the debt is less than what he has, such that he would still have enough to perform Hajj after paying the debt, then he should pay his debt and then perform Hajj. It makes no difference if it is an obligatory Hajj or a voluntary Hajj. However, it is obligatory on him to make haste in performing the obligatory Hajj. In reference to the Hajj that is not obligatory, then it is by choice. If he wishes, he may perform it; and if he wishes, he may leave it; and there is no sin on him.
Source:
Ash-Shaykh Ibn 'Uthaimin
Fatawa Islamiyah, Vol. 4 Pages 60-61