President Donald Trump’s Director of National Intelligence Dan Coats will soon be replaced because he kept doing the one thing Trump couldn’t stand: telling the truth.

In a Sunday tweet, Trump wished Coats well after serving two years in his position and said that Coats will resign officially on August 15. Trump added that he will nominate Rep. John Ratcliffe (R-TX), a staunch Congressional ally who fiercely sided with the president during the Mueller probe, as the nation’s next top spy.

There have been rumblings in recent days that Coats’s departure was imminent. One person familiar with the decision told me that Coats was “not loved in the administration,” and Trump had long wanted him gone.

....be leaving office on August 15th. I would like to thank Dan for his great service to our Country. The Acting Director will be named shortly. — Donald J. Trump (@realDonaldTrump) July 28, 2019

Hours later, Coats’s resignation letter became public. Among other things, Coats made sure to note the “threats against our elections” — an issue Trump continues to minimize or outright ignore.

The likely reason Trump was so disappointed in his intelligence chief in the end isn’t that he did his job badly — it’s that he did it well.

The job of the director of national intelligence is to oversee the entire US intelligence community — a sprawling collection of agencies that includes the FBI, the CIA, and the NSA as well as offices within the Pentagon, State Department, and even the Department of Energy.

The DNI is also meant to serve as “the principal adviser” to the president on all “intelligence matters related to national security.” And it’s in that capacity that he seems to have run afoul of the president.

This was most evident on January 29, when Coats and other top US intelligence officials presented their annual “Worldwide Threat Assessment” report to the Senate Intelligence Committee. That report is supposed to present “the collective insights” of the entire intelligence community about the biggest threats currently facing the United States.

But the picture Coats and his colleagues presented that day was in stark contrast to the picture of the world Trump and his administration have been trying to sell to the American people.

One after the other, Coats and the others testified that ISIS isn’t on the verge of defeat; that North Korea isn’t likely to give up its nuclear arsenal anytime soon; that Iran isn’t currently trying to acquire a nuclear weapon.

They also testified that climate change is not only real but also a genuine national security threat. And they reaffirmed that Russia continues to interfere in US politics and plans to do so again in the 2020 election.

All those assessments, stunningly, countered Trump’s own stated positions and worldview. And he was furious.

The morning after the hearing, Trump tweeted that his intelligence people “should go back to school” because they didn’t agree with his views, particularly when it came to how dangerous Iran really is.

The next day, he summoned Coats and the other officials who’d testified before the Senate to the Oval Office for a group picture — and lied about what they’d said on the record during that Senate hearing.

....I would suggest you read the COMPLETE testimony from Tuesday. A false narrative is so bad for our Country. I value our intelligence community. Happily, we had a very good meeting, and we are all on the same page! — Donald J. Trump (@realDonaldTrump) January 31, 2019

Coats, who’d read the intelligence community’s assessment in front of the Senate, bore the brunt of Trump’s fury. That bodes poorly for whoever may replace him.

“It’s unfortunate that the president deems the DNI’s statement as a sign of disloyalty ... rather than the product of unbiased and expert analytic effort,” Jung Pak, a former top CIA official analyzing North Korea, told me. “If the perception is that the president fired Coats for just simply providing the intelligence community’s assessment, it is likely to cause concern — if it hasn’t already — about the potential for a more activist DNI.”

But it wasn’t the first time Coats had publicly contradicted his boss.

Coats backed the intelligence community more than Trump

In June 2017, during a joint press conference with Russian President Vladimir Putin in Helsinki, Trump was directly asked whether he believed his intelligence community’s assessment that Russia had interfered in the 2016 US presidential election — or whether he believed Putin’s denial that his country had interfered.

Instead of affirming that of course he believed his own intelligence agencies, Trump responded by saying, “I have confidence in both parties.” He continued: “My people came to me, Dan Coats came to me and some others. They said they think it’s Russia. I have President Putin, he just said it’s not Russia.”

That the president was seeming to give equal (if not more) weight to the words of a foreign adversary over the assessment of his own intelligence professionals stunned many — apparently including Dan Coats.

Coats responded shortly after with a strong statement defending the findings of the intelligence community he represented:

STATEMENT FROM DAN COATS: "The role of the Intelligence Community is to provide the best information and fact-based assessments possible for the President and policymakers. We have been clear in our assessments of Russian meddling in the 2016 election..." pic.twitter.com/X1DbEBVEMU — Kaitlan Collins (@kaitlancollins) July 16, 2018

It was an unprecedented public rebuke of the president, and a move that many thought would spell the end of Coats’s tenure in the Trump administration. That perception wasn’t helped when, just a few days later, Coats told a crowd at a major international security conference in Aspen, Colorado, that he disagreed with Trump’s decision to have a one-on-one meeting with the Russian president at all.

But despite all the talk, Coats managed to keep his job. That is, until now. It seems the president finally tired of having his top spy publicly contradict him left and right.

Now it looks like Trump picked someone who will tell him what he wants to hear, not what’s true. That’s a huge problem, as the DNI’s job is to give the president the information he needs to make informed policy decisions.

Which means that while Trump may be happier with whoever his new intelligence director ends up being, America will be less safe for it.