the Messenger of Allah said: "To spit in the Masjid is a sin, and burying it is its atonement."

Jami` at-Tirmidhi Book 6, Hadith 29