Imam al-Shafi'i (may Allah have mercy on him) said: "(This) is because of the large number of people who come to him (the judge) for purposes other than those for which mosques were built."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / Q20262
Abu Hurayrah (may Allah be pleased with him) said: I heard the Messenger of Allah (peace and blessings be upon him) saying: "Whoever announces a lost item in the mosque, say to him: May Allah not return your item to you, for mosques were not built for this."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20262
Ibn Buraydah narrates from his father (Sayyiduna Buraydah, may Allah be pleased with him) that the Prophet (peace and blessings be upon him) heard a Bedouin, or a man, announcing a red camel. The Prophet (peace and blessings be upon him) said: "May you not find it! Mosques are only for that for which they were built."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20263
Sayyiduna Anas bin Malik (may Allah be pleased with him) said: A Bedouin urinated in the mosque, and the Companions of the Prophet (peace and blessings be upon him) (may Allah be pleased with them) said: Stop, stop! The Prophet (peace and blessings be upon him) said: "Do not interrupt his urination." The narrator said: When he had finished, the Prophet (peace and blessings be upon him) called him and said: "Mosques were not made for this, that is, for urine, excrement and filth. Rather, they are made for the recitation of the Qur'an and the remembrance of Allah." Then he (peace and blessings be upon him) ordered the Companions (may Allah be pleased with them), and they brought a bucket of water, and he (peace and blessings be upon him) poured it over it.
(b) In the hadith of Ikrimah bin Ammar: "They are made for the remembrance of Allah, prayer and the recitation of the Qur'an."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20264
Al-Sa'ib bin Yazid (may Allah be pleased with him) said: I was lying down when suddenly a man was throwing pebbles at me. I raised my head, and it was Umar bin al-Khattab (may Allah be pleased with him), who said: Bring these two men to me. I brought them, and Umar (may Allah be pleased with him) asked: "Where have you come from, and who are you?" They said: "From Ta'if." He said: "If you had been from this city, I would have punished you severely; you are raising your voices in the Mosque of the Prophet."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20265
Salim bin Abdullah (may Allah have mercy on him) said: Sayyiduna Umar (may Allah be pleased with him) had built a raised courtyard to one side of the mosque, called al-Butayha'. Whoever wanted to chatter, recite poetry or raise his voice would go to that place.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20266
Sayyiduna Hakim bin Hizam (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) forbade that retaliation be taken in the mosques, that poetry be recited in them, or that the prescribed punishments be carried out in them.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20267
Al-Ala bin Kathir, from Makhul, from Abu al-Darda, Wathilah and Abu Umamah (may Allah be pleased with them), all of whom said: We heard the Messenger of Allah (peace and blessings be upon him) saying from the pulpit: "Keep your mosques away from your children, your insane and your disputes, and protect them from raised voices. Keep them away from the drawing of swords and the carrying out of prescribed punishments, perfume them with incense on Fridays, and place vessels for purification at the doors of your mosques."
This al-Ala bin Kathir is a Syrian and munkar al-hadith (his narrations are rejected). It was also said: from Makhul, from Yahya bin al-Ala, from Mu'adh, as a marfu' report, and that is not authentic.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20268
Jabir (may Allah have mercy on him) said: Umar bin Abd al-Aziz (may Allah have mercy on him) wrote to Abd al-Hamid bin Zayd: Do not pass judgement on the basis of neighbourhood. And he wrote to him: Do not judge in the mosque, for Jews, Christians and menstruating women will come to you.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب آداب القاضي / 20269