Sunan Abi Dawud, Book 2, Hadith 84 (Abu Dawud 474)

Anas b. Malik reported the Prophet(ﷺ) as saying:

Spitting in the mosque is a sin and it is expiated by burying the spittle.