The Messenger of Allah ﷺ said, "Spitting in the mosque is a sin, and its expiation is to bury it."
حدثنا ابن أبي عدي عن سعيد وابن جعفر قال أخبرنا سعيد عن قتادة
أن رسول الله ﷺ قال النخاعة في المسجد خطيئة وكفارتها دفنها
Its isnad is sahih. Saeed is Ibn Abu Aruba, and Ibn Jafar is Muhammad Ghundar. Bukhari related the hadith in 1/113, in the Book of Prayer, chapter on the expiation for spitting, Abu Dawud in 1/128, no. 476, and Muslim with similar wording in 1/390, no. 551.