It is reported through another chain that Sayyiduna Anas (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "Spitting in the mosque is a sin, and its expiation is to bury it."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3589