ENOfficial
Anas reported God's Messenger as saying, “Spitting in the mosque is a sin which is expiated by burying the spittle.” (Bukhari and Muslim.)
Source: sunnah.com
Other translations
Arabic
وَعَنْ أَنَسٍ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «الْبُزَاقُ فِي الْمَسْجِد خَطِيئَة وكفارتها دَفنهَا»
sunnah.com