All perfect praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
The Islamic ruling on wastewater is that it is considered impure (Najis), even if its quantity is large, due to the change in its properties. Therefore, it is not valid to use it for ablution or purification, and it is prohibited to use it. It must be avoided, as AllahThe Almighty Says (what means): "Indeed, Allah loves those who are constantly repentant and loves those who purify themselves." [Al-Baqarah: 222]. In addition, Prophet Mohammad (PBUH) said: "Purity is half of Iman (faith)" [Moslim].
Impure water can be purified by adding a large quantity of clean water, such that the combined amount returns to its original state, free from impurities and their effects in terms of smell, color, and taste. Shaykh al-Islam Muhyiddin al-Nawawi, may Allah have mercy on him, said in [Minhaj Al-Talibin, pp.9]: "Two qullahs of water do not become impure by contact with impurity, but if it changes (in properties), it becomes impure. If the change disappears by itself or by adding water, it becomes pure; but if it changes due to musk or saffron, it does not."
As for the purification method mentioned in the above question, involving chemical treatments and the physical separation of impurities from the water, it is not sufficient to rule that the water is pure. This is because the water has not truly been rid of impurities. Supporting this, the Jordanian Standard for reclaimed domestic wastewater No. 893/2021 states in its provisions that this water cannot be used for all purposes. Its usage is restricted, and it cannot be used for drinking, watering fruit trees that are consumed raw or cooked, or replenishing groundwater used for drinking.
In conclusion, reclaimed wastewater is considered impure according to Islamic law. It is not permissible to use it for ablution, cleaning the body, or washing clothes. It must be avoided in the cleaning of mosques out of respect for them, as they are places of prayer where purity is a requirement. And Allah The Almighty Knows Best.