Sahih Muslim, Book 5, Hadith 69 (Muslim 1222)

Anas b. Malik reported:

The Messenger of Allah (ﷺ) said: Spitting in a mosque is a sin, and its expiation is that it should be buried.