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 bad deed, and burying it is a good deed."
Hadith Referenceالمعجم الكبير للطبراني / باب الصاد / 8060