Allah the Exalted said:
٢٧١ - باب النهي عن التجسس والتسمع لكلام من يكره استماعه
Allah the Exalted said:
O you who have believed, avoid much [negative] assumption. Indeed, some assumption is sin. And do not spy or backbite each other. Would one of you like to eat the flesh of his brother when dead? You would detest it. And fear Allāh; indeed, Allāh is Accepting of Repentance and Merciful.
And He the Exalted said:
And those who harm believing men and believing women for [something] other than what they have earned [i.e., deserved] have certainly borne upon themselves a slander and manifest sin.
It is related from Abū Hurayrah (may Allah be pleased with him) that the Messenger of Allah ﷺ said: "Beware of suspicion, for suspicion is the falsest of speech. Do not pry, do not spy, do not vie with one another, do not envy one another, do not hate one another, and do not turn your backs on one another; rather be brethren, O servants of Allah, as He has commanded you. The Muslim is the brother of the Muslim: he does not wrong him, nor forsake him, nor despise him. Piety is here, piety is here" — and he pointed to his chest — "It is enough evil for a man that he should despise his Muslim brother. The whole of a Muslim is inviolable to another Muslim: his blood, his honour, and his property. Allah does not look at your bodies, nor at your forms, but He looks at your hearts and your deeds." In one narration: "Do not envy one another, do not hate one another, do not spy, do not pry, do not outbid one another to inflate prices, and be brethren, O servants of Allah." In another narration: "Do not sever ties, do not turn your backs on one another, do not hate one another, do not envy one another, and be brethren, O servants of Allah." And in another narration: "Do not shun one another, and let none of you sell against the sale of another." Muslim reported it with all these wordings, and al-Bukhārī reported most of them.
It is related from Muʿāwiyah (may Allah be pleased with him) who said: I heard the Messenger of Allah ﷺ saying: "If you go searching out the faults of the Muslims, you will corrupt them, or you will nearly corrupt them." A sound hadith, reported by Abū Dāwūd with a sound chain of transmission.
It is related from Ibn Masʿūd (may Allah be pleased with him) that a man was brought to him and it was said to him: This is so-and-so, whose beard is dripping with wine. He said: We have been forbidden from spying, but if something becomes apparent to us, we will act upon it. A good and sound hadith, reported by Abū Dāwūd with a chain meeting the conditions of al-Bukhārī and Muslim.