In the name of Allah, the Most-Merciful, the All-Compassionate
As-Salaam Alaikum Wa-Rahmatullahi Wa-Barakatuhu
"May the Peace and Blessings of Allah be Upon You"
Praise be to Allaah, we seek His help and His forgiveness. We seek refuge with Allaah from the evil of our own souls and from our bad deeds. Whomsoever Allaah guides will never be led astray, and whomsoever Allaah leaves astray, no one can guide. I bear witness that there is no god but Allaah, and I bear witness that Muhammad is His slave and Messenger.
Major Sins #69: Spying on the Muslims and Revealing their Weaknesses - By Imam Dhahabi
Included in this subject is the hadith of Hatib Ibn Abi Balta’ah (1) (who sent a secret letter telling of the Muslims military plans to his relatives in Mecca in hopes that they would not get hurt), 'Umar (Allah be well pleased with him) wanted to kill him for what he had done, but the Prophet (pbuh) forbade 'Umar to, as Hatib had fought at Badr (and by accepting Hatib's excuse, left nothing for any Muslim to criticize. [This story ismantioned in the Sahih of AI-Bukhri]
If someone's spying entails undermining Islam and its people, or the killing of captives, enslavement, or plundering of the Muslims, or anything of the like, then he is one of those who strive for corruption in the land, destroying tillage and offspring, and he is subject to death, and deserves the torment (of Hell-Fire), may Allah save us from it, Anyone who spies necessarily knows that if ordinary talebearing is a major sin, spy's carrying information is far more abominable and heinous, May Allah save us from that for He is the Ever-Clement?