I woke up yesterday at 5 am for a call with a colleague in China. Fifteen minutes from quitting time, a critical system died, and I was here until 1 am fixing it. A mile from home, achingly tired and needing a bed, a police car pulled me over for having one brake light out. After 10 minutes of staring at incredibly bright, flashing blue lights in the mirror, they let me go with a warning. Got home, and because of said flashy bright lights, I couldn't go to sleep. So here I am back at work, hour 34 of wakefulness.
From her perspective, the police officer was trying to protect and serve (I know her vaguely through friends and she sounds like a decent person) From my perspective, I'm probably more dangerous to my fellow drivers due to my lack of sleep during rush hour commute than I would be for having 1 (out of 4) rear lights out at 2 am a mile from home. From my perspective (and almost certainly from society's perspective), her actions *did not* protect or serve either myself or society very well.
I don't think the leaders of the NSA, CIA, etc are a bunch of Dr Evil wanna-be's. I suspect they are in fact decent, well-intentioned people. But what from their perspective seems rational, can be contrary to the greater good.
In that, their job is somewhat like mine as a sysadmin. I have never once had someone email me and say "Hey, everything was working great this morning, just wanted to say good job!". But when something breaks, there are a hundred people complaning loudly. There's a fundamental asymmetry there, and it can lead to personal incentives that are in conflict with the greater good.
The NSA/CIA/etc are graded on "how successful they can defeat/thwart the bad guy", and not "doing what is in the best interest of society". Perfect is the enemy of the good, and it's better for society to preserve our hard-won freedoms, even at the cost of the bad guys winning occasionally. But they get yelled at (Congressional hearings, public firing etc.) when they do the right thing, so they do the "right" thing instead.