It is narrated from Sayyiduna Sa'd (may Allah be pleased with him) that I heard the Prophet (peace and blessings of Allah be upon him) say: "If any one of you spits in the mosque, he should conceal it so that it does not touch the body or clothes of any Muslim and cause him harm."
Hadith Referenceمسند احمد / مسند باقي العشرة المبشرين بالجنة / 1543