and he scraped it away, which shows that when a person sees anything harmful or filthy in the mosque, he must remove it.
As for Anas’s second hadith, it concerns the Bedouin who came into the mosque and, out of ignorance—since most Bedouins were unaware of the rulings—urinated in one of its corners. The people rebuked him, but the Prophet (peace and blessings be upon him) forbade them from doing so. When the man had finished, the Prophet said to the Companions, “Pour a bucket of water over his urine.” He then called the Bedouin and said, “These mosques are not suitable for anything filthy or impure; they are only for prayer, the recitation of the Qur’an, and remembrance of Allah.” Thus the Messenger (peace and blessings be upon him) made it clear that nothing dirty or harmful is appropriate in the mosques.
For this reason, a believer must honor the houses of Allah: he should neither throw dirt or filth into them nor raise his voice within them. Instead, he must observe proper etiquette, for the mosques are the houses of Allah and the abode of the angels. Allah is the One who grants success.