Shu'bah reported: I asked Qatada about spitting, in the mosque. He said: I heard Anas bin Malik (RA) say: I heard the Messenger of Allah (ﷺ) say: Spitting in the mosque is a sin, and its expiation is that it should be buried.
Hadith ReferenceSahih Muslim / The Book of Mosques and Places of Prayer / Hadith: 552