When you get a clearance, and often even when just working with confidential documents, the DoD has you sign an SF312, which is a classified information non-disclosure.
When you join the military, one of your first acts is to be sworn in, and you swear an oath, "I do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies foreign and domestic; that I will bear true faith and allegiance to the same. That I will obey the orders of the President of the United States and the orders of the officers appointed over me, according to regulations and the Uniform Code of Military Justice. So help me God."
Now let me say this as clearly as possible:
The Constitutional oath outranks the NDA. Period. If in doubt, the oath wins, every single time.
That being said though, there is more room for nuance in the stories, primarily due to what kind of information is revealed, what it's intended purpose was, and who is was distributed to.
In my opinion Snowden was more aware of this than Manning, because he did due diligence to review the documents before sharing them, and then making sure to limit damaging information that was actually vital to actual national security, and was very specific with the organizations he shared the information with about these requirements.
Manning did a huge document dump, which I think was well intentioned and had the right reasons behind it, but he didn't think it through in detail enough or take the time to redact the information.
So even if the constitutional oath outweighs the SF312 NDA, it's still breaking the law, but we need to draw very clear distinctions between breaking an NDA and the too oft-cited charges of "treason", which by definition is aiding and abetting the enemy during times of war.
I would also like to point out the hypocrisy of the establishment when it comes to classified leaking, because people in the White House and on the Hill leak all kinds of classified material whenever it happens to be expedient to them politically. A good example of this is the Cheney leak that outed Valerie Plame. Where are the cries about treason against Cheney? (whom I personally think is demonstratively more of a traitor than any of the aforementioned names...)
To me, one of the primary problems DoD faces these days is that there is little to no punishment for being openly unconstitutional, and people have not only forgotten their oaths and their importance, but have failed to call out others who have acted against theirs. To me, an oath still means something, but I want to know... if I could prove someone broke their oath with knowledge, what is the legal punishment offered?
Whatever it is, that is what we need to be doing against those in positions of power who spend more effort undermining the constitution than defending it. (and personally, I think the true enemies of the constitution wear business suits and ties, not thwabs...looking at you wallstreet)