Sahih al-Bukhari, Book 8, Hadith 65 (Bukhari 409)

Narrated Anas bin Malik:

The Prophet (ﷺ) said, "Spitting in the mosque is a sin and its expiation is to bury it."