This is the difficult part about dealing with classified matters: anything involving the secrecy of eavesdropping methods is very highly classified and there is a whole special section of law related to protection of communications intelligence (18 USC 641), much in the way there is a special section of law relating to disclosure of the identities of CIA operatives. Disclosure of this kind of information is absolutely, unquestionably, without a doubt a violation of that law.
However, in the absence of any specific information about what effects the disclosure of the program may have had on tracking down real terrorists, I certainly see that the public has an compelling interest in knowing this kind of information. It is very hard to see how the disclosure of the controversy about the legality of the program hasn’t greatly served the public interest.
So we have someone who allegedly broke the law, but the country is probably much better off, in balance, for knowing that the President may have seriously abused his power. Where does it leave us? Most journalists have the conviction to go to jail to protect their sources. Maybe civil servants ought to share the same devotion to their cause: if you’re willing to break the law, even if it is for the perceived benefit of the country, maybe you shouldn’t pretend that you didn’t do something illegal, and accept the punishment.
Of course, I have no idea if this guy was the leaker; I’m just stating a general principle.