It's not "leaking confidential information" if the information is evidence of ongoing criminal activity. Imagine that the government was kidnapping children and grinding them into a paste for use as a new MRE flavor. Would you put the person who told the media about this up for trial on espionage charges? Of course not. You'd use the evidence to convict the people that were grinding up the children.
This is the same thing except on a more abstract level of illegality.
This is the same thing except on a more abstract level of illegality.