Sahih Muslim 1528
The Book of Mosques and Places of Prayer
وَحَدَّثَنَا هَارُونُ بْنُ مَعْرُوفٍ، وَإِسْحَاقُ بْنُ مُوسَى الأَنْصَارِيُّ، قَالاَ حَدَّثَنَا أَنَسُ بْنُ عِيَاضٍ، - حَدَّثَنِي ابْنُ أَبِي ذُبَابٍ، فِي رِوَايَةِ هَارُونَ - وَفِي حَدِيثِ الأَنْصَارِيِّ حَدَّثَنِي الْحَارِثُ - عَنْ عَبْدِ الرَّحْمَنِ بْنِ مِهْرَانَ مَوْلَى أَبِي هُرَيْرَةَ عَنْ أَبِي هُرَيْرَةَ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ " أَحَبُّ الْبِلاَدِ إِلَى اللَّهِ مَسَاجِدُهَا وَأَبْغَضُ الْبِلاَدِ إِلَى اللَّهِ أَسْوَاقُهَا " .
Abu Huraira reported that the Messenger of Allah (ﷺ) said:The parts of land dearest to Allah are its mosques, and the parts most hateful to Allah are markets
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.