The Prophet ﷺ said: "O people, Allah is Ṭayyib (Good) and accepts only that which is good," and he then mentioned the traveller, dishevelled and dusty, raising his hands to the sky calling "O Lord, O Lord," while "his food is unlawful, his drink is unlawful, his clothing is unlawful, and he is nourished by the unlawful — so how can he be answered?" (Sahih Muslim 1015). The majority of scholars hold that such a Hajj is legally valid and discharges the obligation, since the rites themselves were performed correctly, but the person is sinful and has gravely endangered the acceptance and reward of his Hajj. It is reported from Imam Aḥmad that such a Hajj is not accepted at all, while the well-known position of his school is that it is valid though the man is sinful — a recognised difference of opinion. Either way the safe path is agreed upon: repent, purify one's wealth, and spend only what is lawful on the journey to Allah's House, for Allah says: "O you who believe, spend from the good things you have earned" (Quran 2:267).
Q&A · Hajj
Is Hajj accepted if it is performed with unlawful (harām) money?
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.