Sayyiduna Abu Umamah (may Allah be pleased with him) reports this saying of the Prophet (peace and blessings be upon him): "Whoever spits in the mosque and then does not bury it, that is a bad deed; and if he buries it, that is a good deed."
Al-Tabarani recorded it in al-Mu'jam al-Kabir, and its narrators have been deemed trustworthy (muwaththaq).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 2002