haram (unlawful) money. The money of interest is malignant because riba is strictly prohibited. However, performing Prayer in a mosque built by unlawful money is acceptable, in sha’ Allah, and the one performing the Prayer will not be committing a sin.
Dr. Husam al-Din Ibn Musa `Afana, professor of the principles of Islamic jurisprudence at the University of Jerusalem states: Islam urges people to build mosques and to care for them. Allah Almighty says, “The mosques of Allah shall be visited and maintained by such as believe in Allah and the Last Day, establish regular prayers, and practice regular charity, and fear none (at all) except Allah. It is they who are expected to be on true guidance” (At-Tawbah: 8). Maintaining mosques is achieved both by constructing them and praying in them. `Uthman ibn `Affan (may Allah be pleased with him) narrated: I heard the Messenger of Allah (peace and blessings be upon him) saying, “Whoever builds a mosque for the sake of Allah, Allah will build for him a house in Paradise” (Al-Bukhari and Muslim). Also, `Abdullah ibn `Umar (may Allah be pleased with him) narrated: I heard the Messenger of Allah (peace and blessings be upon him) saying, “Whoever builds a mosque for the sake of Allah even if it is as small as the nest of a hen, Allah will build for him a palace in Paradise” (Ahmad).
The money paid to build a mosque for the sake of Allah Almighty ought to be good and halal (lawful). It is not permissible to build mosques by the use of haram money such as money gained by interest, lottery, gambling, and so on. Thus, any money gained by interest is ill-gotten because riba is a grave sin, and Allah Almighty is good and accepts only that which is good. In this context, the Prophet (peace and blessings be upon him) said, “Surely, Allah Almighty accepts alms, and He accepts only what is good from them, Whoever gives a good charity—and Allah accepts only that which is good—the All-Merciful (Allah) will take it by His right (hand)”(Al-Bukhari and Muslim).
On the other hand, Abu Hurayrah narrated that the Messenger of Allah (peace and blessings be upon him) said, “Whoever illegally collects money and then gives it in charity, he will not be awarded for it, but rather he will be sinful” (Ibn Haban and Al-Hakim).
Based on the above, it is not permissible to construct mosques with haram money because it is illegal and must not be used to build the houses of Allah Almighty. That’s also in order to protect the houses of Allah from any malignance or illegal money. If the houses of Allah are preserved from minor dirt like spit and mucus, then they are worthier to be preserved from such grave impurities. It was the custom of the Arabs—even before Islam—to protect the Ka`bah.
However, performing Prayer in a mosque built by unlawful money is acceptable, in sha’ Allah, and the one performing the Prayer will not be committing a sin. One who got this money illegally—though he built a mosque—will be sinful from ill-gotten money.