The oath is to defend the Constitution against all enemies, foreign and domestic. A lot of people seem to be confused about who the real enemies of the Constitution (particularly the Fourth Amendment) are.
Put another way: Hopefully you were taught that it is your duty not to obey an unlawful order from a superior.
I don't know where you got the idea that he began his career with an intent to leak details of the government's illegal actions. According to him, he came across the report that finally led to the decision purely by accident.