"The Messenger of Allah (ﷺ) said: 'Spitting in the Masjid is a sin, and its expiation is to bury it.'"
Sunan an-Nasa'i Book 8, Hadith 36