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."
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