Sheikh `Abdul-Majeed Subh, a prominent Azharite scholar, states: “There is nothing wrong from the Shari`ah point of view in men working in cleaning public toilets and taking salary for that. There is also nothing wrong in volunteering to do that act and we can see in the time being and across history Muslim men volunteering to clean toilets in mosques to keep them clean. Even in the lifetime of the Prophet (peace and blessings be upon him), he ordered the people of As-Suffah (some poor Muslims whom were residing in the Prophet’s Mosque) to clean their courtyards and not to leave garbage there.
So, there is no prohibition in Islam for Muslim men to work in cleaning public toilets.”