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.)
I'm just disagreeing with the premise that even having a trial is itself unjust.
The dictionary definition is justice is "the quality of being fair and reasonable." Is there anything fair ad reasonable about how Snowden is about to be treated?
Yeah, it is. But the law is there and we still have to follow it until we can change it. Part of what makes people that conscientiously break the law for personal beliefs heroes (insert civil rights activist of choice here) is that they do so knowing that they are going against the law and willingly face that.
I respect a person who will take a stand and face the consequences of their actions.
The whole concept of "legality" is (sadly) appropriated by governments. The government invents the rules for itself and other organizations and individuums. They ca invent whatever rules they like. Gulag was perfectly legal. Nazi concentration camps were perfectly legal.
It is stupid to assume that one's actions are bad just because they are against the law.