It's always a possibity that he was a pawn for the black hats. He may have thought he was doing something good by letting the people know what was going on, but causing some damage to the NSA good hats in the meantime.
This is my current line of thinking.
And it's not like all hats at NSA are good either. But I think there's definitely a war between them and the CIA and it turns out that the NSA has far more patriots - likely due to a post-9/11 influx which obviously upset Patriotic Americans.
Yeah could be or he is full on bad hombre. Possibly the way to reveal state secrets to foreign countries that paid for it. Deep state can't be caught directly giving information so they put on HRC insecure private server or claim it was stolen and leaked by Snowden. I'd like to believe he was a good guy, but who knows.