Sayyiduna Abu Hurairah (may Allah be pleased with him) reports that the Messenger of Allah (peace and blessings be upon him) said: When any one of you spits in the mosque, he should bury it; if he cannot do so, then he should spit into his garment.
Hadith Referenceالفتح الربانی / أبواب المساجد / 1342