[Impact per unit of spying] X [number of spies caught] - [impact per unit of innocent person being impacted] X [number of innocent people falsely accused] = net impact to society
Typically, the first part of the equation is wildly overestimated because by stopping spies in 1 area, they just find another way to do what they want to do and the impact happens anyways. Or the threat evolves over time but the policies do not resulting in negative side-effects and very little benefit anymore (e.g. the TSA)