عَنْ أَبِي غَالِبٍ أَنَّهُ سَمِعَ أَبَا أُمَامَةَ يَقُولُ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ: ((التَّفْلُ فِي الْمَسْجِدِ سَيِّئَةٌ وَدَفْنُهَا حَسَنَةٌ))
It is narrated from Sayyiduna Abu Umamah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: Spitting in the mosque is an evil, and burying it is a good deed.