Hadith
حَدَّثَنَا مُسْلِمُ بْنُ إِبْرَاهِيمَ، حَدَّثَنَا هِشَامٌ، وَشُعْبَةُ، وَأَبَانُ، عَنْ قَتَادَةَ، عَنْ أَنَسِ بْنِ مَالِكٍ، أَنَّ النَّبِيَّ صلى الله عليه وسلم قَالَ " التَّفْلُ فِي الْمَسْجِدِ خَطِيئَةٌ وَكَفَّارَتُهُ أَنْ تُوَارِيَهُ " .
Anas b. Malik reported the Prophet(ﷺ) as saying:Spitting in the mosque is a sin and it is expiated by burying the spittle
Sahih · Al-Albani
Sunan Abi Dawud 474 ·Book 2, Hadith 84·Also available on sunnah.com·