We went on till we came to Jabir bin 'Abdullah (RA) in the mosque and he was busy in observing prayer in one cloth which he had joined at its opposite ends. I made my way through the people till I sat between him and the Qibla and I said: May Allah have mercy upon you. Do you observe prayer with one cloth on your body whereas your mantle is lying at your side? He pointed me with his hand towards my breast just like this and he separated his fingers and bent them in the shape of a bow. And (he said): I thought that a fool like you should come to me so that he should see me as I do and he should then also do like it. Allah's Messenger (ﷺ) came to us in this very mosque and he had in his hand the twig of the palm-tree and he saw mucus towards the Qibla of the mosque and he erased it with the help of the twig. He then came to us and said: Who amongst you likes that Allah should turn His face away from him? We were afraid. He then again said: Who amongst you likes that Allah should turn His face away from him? We were afraid. He again said: Who amongst you likes that Allah should turn His face away from him? We said: Allah's Messenger, none of us likes it. And he said: If one amongst you stands for prayer, Allah, the Exalted and Glorious, is before him he should not spit in front of him, or on his right side, but should spit on his left side beneath his left foot and if he is impelled to do so all of a sudden (in spite of himself) he should then spit in his cloth and fold it in some part of it. (and he further said:) Bring some sweet-smelling thing. A young man who belonged to our tribe stood up, went and brought scent in his palm. Allah's Messenger (ﷺ) took that and applied it to the end of that twig and then touched the place where there had been mucus. Jabir said: This is why you should apply scent to your mosques.
Hadith Referenceصحيح مسلم / كتاب الزهد والرقائق / 3008
Narrated Ubadah ibn as-Samit: We came to Jabir ibn Abdullah who was sitting in his mosque. He said: The Messenger of Allah ﷺ came to us in this mosque and he had a twig of date-palm of the kind of Ibn Tab. He looked and saw phlegm on the wall towards qiblah. He turned to it and scraped it with the twig. He then said: Who of you likes that Allah turns His face from him? He further said: When any of you stands for praying, Allah faces him. So he should not spit before him, nor on his right side. He should spit on his left side under his left foot. If he is in a hurry (i. e. forced to spit immediately), he should do with his cloth in this manner. He then placed the cloth on his mouth and rubbed it off. He then said: Bring perfume. A young man of the tribe stood and hurried to his house and returned with perfume in his palm. The Messenger of Allah ﷺ took it and put it at the end of the twig. He then stained the mark of phlegm with it. Jabir said: This is the reason you use perfume in your mosques.
Shaykh Umar Farooq Saeedi
485. Commentary: Saliva, phlegm, or nasal discharge are not impure (najis); if they get on clothing, the clothing remains pure. However, this is completely contrary to cleanliness. It is obligatory to show utmost respect and honor to the mosque and other revered places and objects.
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 485