What fundamental concepts are needed to build a theory of the ethics
of spying?
Before we can evaluate the ethics of spying, we need to define what “wrong” even means. Is something wrong because it causes harm to an individual? If so, spying wouldn’t be wrong in cases where it’s executed perfectly (i.e. the subject never finds out). So instead, let’s define wrongness as the degree to which an action harms human society as a whole—a kind of societal consequentialism that seems aligned with the spirit of the original question.
We also need a working definition of “spying.” In this context, let’s define it narrowly as the covert acquisition of information about an individual or group, in service of a perceived greater good. This lets us focus on cases where the intentions are arguably benevolent, such as national security or anti-corruption investigations.
Let's take the simplest example: a government entity spies on an individual, gathering information that helps them identify and extinguish corruption, therefore benefiting society.
But on a more meta level: While no specific individual is aware that they are being spied on at any given moment, perhaps the fact that we are even discussing this question is evidence that the possibility of you being spied on is non-zero. Think about the last time you placed a piece of tape over your laptop camera, or made a joke about your devices listening in on you. Even if these perceptions are relatively harmless for 99% of people, it creates an ambient low-trust environment, where people are always aware that their privacy is something that they must take into their own hands, and that their government cannot be totally relied upon to respect it.
So what I'd say is: on an individual practical level, spying is not "wrong" by our pre-defined parameters, but on a larger societal level, you can make some defensible argument that it has invisible psychological impacts like self-censorship, loss of public trust, and the erosion of democratic consent in surveillance culture.
To be clear, this analysis relies on intentionally narrow definitions of both spying and morality—both aligned with a utilitarian framework—because that seems to be the ethical lens implied by the original question.
You can also consider this alternate definition:
Spying - to acquire information about an entity without their knowledge or consent, regardless of intention. This may include state sponsored surveillance to suppress dissent. And it adds to the question: if we believe that spying is good so long as a government entity is doing it in good faith, how can we be sure that they are measuring their "goodness" through unbiased lenses?