He signed a bunch of documents where he promised to not disclose anything. He was perfectly aware that he was violating those agreements as well as probably both civil and military law.
Regardless of how important an impact the release had he's still a traitor to the US. No number of "privacy is an illusion" rulings will change that.
I presume that capital punishment is an option for traitors which makes getting of the hacking charge a minor thing anyways.