This seems fairly obvious, clearly vast amounts of possible wrongdoing, once exposed, could genuinely damage reputation abroad to some degree.

So how did such a law ever survive scrutiny?

It seems like a blanket ban on exposure of nearly all possible wrongdoing.

> It seems like a blanket ban on exposure of nearly all possible wrongdoing.

And a proportional increase in power goes with that ban on exposing wrongdoing. Which is absolutely the goal of secrecy in government.