It is narrated from Sayyiduna Abu Umamah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Spitting in the mosque is a sin, and its expiation is burying it."
Hadith Referenceالمعجم الكبير للطبراني / باب الصاد / 8063