It is narrated from Hazrat Abu Umamah (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) said: Spitting in the mosque is a sin, and mixing it into the soil is a good deed.
Hadith Referenceمسند احمد / مسند الأنصار رضي الله عنهم / 22243
Hadith Gradingحکم دارالسلام:صحيح لغيره، وهذا إسناد حسن فى المتابعات والشواهد من أجل أبى غالب