There's a difference between a whistleblower and someone who leaks top secret information on their own.
A whistleblower goes through proper channels and reports to a government agency. A leaker just hands shit over to Julian Assange and lets the world have a field day with it, they are not whistleblowers and do violate the espionage act.