It was narrated from Ibn 'Umar that the Messenger of Allah (ﷺ) saw some sputum on the Qiblah wall. He scrapped it off then he turned to the people and said:
When any one of you is praying, let him not spit in front of him, for Allah is in front of him when he prays.