The obsession with the law is because we're a democracy, albeit far from a perfectly functioning one.
In the governments of the past, we had laws, but the king could overrule them as desired. The move to democracy involved to things: the laws being dictated by the people and the LAW being king--there's no higher power to overrule it. It can only be changed under the established procedures. That procedure is cumbersome and slow, by design (and perhaps now somewhat corrupted, sadly), but still better than the whims of the monarch.
There's a lot to be said for "what's right is king" rather than "law is king". Ideally "what's right" (probably a subset of what's right--e.g., I should be allowed to be a jerk so long as I don't violate important rights) should be democratically codified into law.
Alas, what we have now is secret, undemocratic codification of laws. Obama said in the programs' defense, "We're going to have to make some choices as a society". That's the key issue, I think: they decided to make the decision to the exclusion of society.
So maybe you're right and what's legal is less relevant than it would be in a fully functional democracy. At this point, the social contract to follow the proper democratic procedure has been violated by the makers and enforcers of the law, and following the law is consequently much less of a moral imperative.
Still, I think if we're not ready for armed revolution, legal procedure isn't entirely irrelevant. MLK's letter from Birmingham Jail is something I turn to a lot on this issue: there are times when you should break the unjust law, but when doing so, you must accept the legal repercussions.
Of course, MLK's legal consequences were a small amount of jail time. Snowden's are already significantly harsher, even without them taking him in.
(I think the gulag is a poor example, because it wasn't democratically established. The Nazi concentration camps seem like a pretty good comparison, but not because I consider them perfectly legal. Hitler was democratically elected, but I don't believe many Germans at that time were even aware of the concentration camps. They're a lot like the NSA programs in that way. They needed to make that decision as a society, but weren't given the opportunity. Thus, I don't consider them perfectly legal.)