Sunan an-Nasa'i, Book 8, Hadith 36 (Nasa'i 725)

It was narrated that Anas said:

"The Messenger of Allah (ﷺ) said: 'Spitting in the Masjid is a sin, and its expiation is to bury it.'"