All countries are attempting to spy on each other. Of course they are. If you expect your country not to because of some misguided belief that this would make them a "good guy" you're just asking for your country to be weaker than others.
It's not cognitive dissonance. That's like saying, "Gee you don't like when the other team scores a goal, but you sure are happy when your team does it!"