Anas bin Malik (May Allah be pleased with him) said:
The Messenger of Allah (ﷺ) said, "Spitting in the mosque is a sin, and its expiation is that the spittle should be buried in earth."[Al-Bukhari and Muslim]. (AR)
App reference (AR): Book 18, Hadith 183 (AR)
Arabic/English book reference (AR): Book 18, Hadith 1693 (AR)