If you think that’s bad, you should read up on what the author Tim Weiner did. He outed a CIA informant in the newspaper because he could, which directly led to the man’s death. Timothy Weiner has blood on his hands.
"If you think CIA incompetence leading to hundreds of informants being burned is bad, wait til you hear about a journalist publishing a story that maybe burned one informant for what they consider a good reason."
I read the show notes but didn't listen to the podcast. Is this really true? The linked New York Times article by Weiner never names the subject, but instead reports on a "retired terrorist" [1]. I don't see this an "outing."
That's wrong. Most journalists recognise that when there's a risk of causing someone's death if they release certain details, they have to consider whether or not it's responsible to do so. So while they do exist to sell newspapers (or, more likely, get clicks for online ads) the majority of journalists and orgs aren't quite heartless enough to literally name an informant knowing it'd cause them to be exposed and killed.
In this case though, Weiner did not "literally name" the informant in The New York Times article [1]. He referred to the informant as a "retired terrorist" without giving a name.
In general, you're right about the principle of keeping sources anonymous to avoid harm. One principle in journalism ethics [2] is to "identify sources clearly" so the public can better understand a source's motives. But the other is to minimize harm ("Balance the public’s need for information against potential harm or discomfort.") to both the sources and the public, motivating anonymity in certain cases.
However, in this instance, Weiner didn't name the informant in the article.
And their employeer. It seems that journalists also cultivate sources and use some spycraft in communications. One does so for their government/country, the other for their newspaper.
John le Carré (the late novelist who was a British intelligence officer in the 1960s) was once asked why states have intelligence agencies when investigative journalists often do the same sorts of things and often report the same information spies do, and he responded that while this is often the case, the problem is that governments tend not to listen to journalists.