Proper government does very, very little except for defend or retaliate against initiated force. So, in that sense it is hard to imagine legitimate government secrecy that doesn't involve defense or retaliation.
But here is a minor example. If the government is going to contract for work to be done on a court house and issue a request for bids, then they need to keep the bids secret till they have accepted one of them. Keeping them secret while the bids are being accepted is acting to protect the taxpayer's money, keeping it secret afterwards would be acting to protect bureaucrats from taxpayer's awareness.
Notice that my example used a court house. That is because protection of individual rights by a government requires the existence of courts and they have to be in a building and a building will on occasion require some work done and the work will cost money and it is only common sense that the government should attempt to use sensible business practices to get a reasonable price for the work. This is a case where protecting individual rights requires lots of activities that aren't directly using force in defence or retalition.
You agree that in the WWII D-Day scenario it is right for the government to convict and imprison solely for revealing information. Then how to explain that as a proper principle? (The same kind of thing applies to the FBI putting an agent in undercover to break a bank robbery gang.)
Note that there is a distinct difference between creating a secret, and using force against a person that reveals it. Two distinct acts. In the case of the contract bidding, the temporary secret part is okay, but if a government clerk revealed the bids, is there a sound position for putting that clerk in jail? In this case, I'd say that if the clerk gave the secret to a contractor for cash, it is participation in a fraud on the taxpayers and he should be jailed. But if the clerk made the bids public, the most that should be done is to fire him. He violated employment terms (a contract) but he wasn't complicit in the initiation of force, fraud or theft.
The D-Day traitor was actively aiding the enemy who were initiating force against us and thereby shares the guilt of the initiated force.
So, I'd say that for the government to use force (imprison someone) they must be able to make a case that the revealing of the secret actively, and materially aided individuals who initiated force, or that the revealing of a secret was itself part of an intentional fraud scheme. That's not so hard. But how to say where it is proper for government to have a secret and where it shouldn't is not so easy.
I'd say that there is a moral duty of government employees and leaders to not hide what they are doing from the citizens with the exception of "X". But it is hard to define those different conditions that make up "X". What we should have is a kind of legal, contractual arrangement with those in government about what they can keep secret. And we do have that... to a degree. We are supposed to have oversight by our elected representatives on secrets. And there are supposed to be definitions of what can be kept secret. But that isn't working.
(And I agree with you that the government is upset with Snowden because he exposed their wrong doing, but their emotional reactions don't tell us what moral/legal principles should govern government secrecy).
I'm having a hard time defining the exceptions to what should be public. Aiding the enemy is clearly one - it derives from initiation of force. Another example is where the cops or the prosecutor withhold information, or will even lie to a suspect during interrogation: "We know you and your buddy robbed that store. He has already confessed."
I have a moral right to say what I want. Speech is an action taking place in a social context that should be free to exercise. The First Amendment makes it a legal right as well. But I am free to give up some part of that moral and legal right by choosing to sign a non-disclosure agreement. And my freedom of speech doesn't wash away the effect of speech used in a fraud.
Snowden aided the American people by revealing government wrong doing, but he also aided an active enemy that we are attempting to fight. I think that exposing the NSA's wrong doing is far more important than Snowden's wrong-doing, but I think it is a failure to see his acts as all good, or to make a hero out what to me looks like confused and ideologically flawed individual.
With a truely tiny government that is only concerned with the defense of individual rights it is very unlikely that this would ever be a pressing issue.