The morning after his national security adviser resigned in disgrace, President Trump issued a cry for help on Twitter:

The real story here is why are there so many illegal leaks coming out of Washington? Will these leaks be happening as I deal on N.Korea etc? — Donald J. Trump (@realDonaldTrump) February 14, 2017

Why indeed? It had been a pretty rough week for Trump by the time he tweeted, and it was only Tuesday morning. From Trump’s vantage point, the proximate cause of his troubles wasn’t the news being reported on, but the fact that it had been leaked.

But before damaging news is leaked, damaging events have to actually occur. And even a cursory examination of the leaks about which Trump is complaining reveals that the real problem isn’t leakers, or hostile bureaucrats. It’s Donald Trump.

The core problem was that Donald Trump chose to hire Michael Flynn

Take Michael Flynn, who at 24 days has set the record for shortest tenure as national security adviser in the history of the office. It should have been extremely obvious well before Trump won the presidency that Flynn was not an acceptable choice for a senior national security job. He was forced out of his last major job, as head of the Defense Intelligence Agency, in 2014, after alienating officials in the Pentagon, CIA, and Director of National Intelligence’s office alike.

According to the Washington Post’s Dana Priest and Greg Miller, “Former subordinates at the DIA said Flynn was so prone to dubious pronouncements that senior aides coined a term — ‘Flynn facts’ — for assertions that seemed questionable or inaccurate.” Priest and Miller spoke to Flynn about that departure, and he asserted that it was “a political purge orchestrated by an (Obama) administration unwilling to heed the warnings he was sounding about militant Islam. Asked for evidence, he said, ‘I just know!’”

After being forced out, Flynn leaned hard into right-wing, anti-Muslim crankery. "I asked why Flynn got fired," Colin Powell, the former secretary of state and national security adviser, wrote in an email to his son that has since been leaked. "Abusive with staff, didn’t listen, worked against policy, bad management, etc. He has been and was right-wing nutty every [sic] since."

As Flynn became a more vocal conservative activist — leading chants of "lock her up" at the Republican National Convention, tweeting, "Fear of Muslims is RATIONAL" — former colleagues like retired Gen. Stanley McChrystal (who worked with Flynn in Iraq and Afghanistan) and retired admiral and former Joint Chiefs of Staff Chairman Michael Mullen contacted him and urged him to cut it out. Two other retired officers told Vox's Yochi Dreazen that they viewed Flynn as "unhinged."

Flynn also showed a remarkable willingness to cozy up to dictatorial regimes — especially when they’re paying. On Election Day, he wrote an op-ed calling on the US to extradite Fethullah Gülen, an exiled Turkish cleric whom the current regime in Turkey blames for a July coup attempt; Flynn compared the coup to 9/11 and asked what the US would do if Osama bin Laden were living peacefully in Turkey. But when the coup actually happened, Flynn called it something “worth clapping for” and attacked the Turkish government. What happened in between is that a Turkish government–aligned firm hired Flynn’s private intelligence firm.

Most revealing of all, Flynn repeatedly took a sympathetic line with regards to Russia, appearing regularly on its propaganda network RT and accepting payment for a speech at a 2015 anniversary party for the channel — a party at which he was seated next to Vladimir Putin. "People went crazy," retired Brig. Gen. Peter Zwack told the Post's Priest and Miller. "They thought it was so out of bounds, so unusual."

Then, after all of this, Trump hired this person as national security adviser. If the White House didn’t have all this information, it should have — it was all public knowledge. The Priest and Miller story came out in August. Trump hired Flynn anyway. That was his first mistake.

His second was keeping Flynn as long as he did.

Flynn’s misconduct was very predictable

Flynn was forced out for behavior that could have been easily predicted ahead of time. First and foremost, he discussed America’s sanctions on Russia in a conversation with the Russian ambassador, and hinted that the Trump administration could be willing to ease them. This was a huge breach of protocol; Flynn was not yet a White House official when these conversations took place, and the norm is for the president-elect's team to defer to the outgoing president.

And then there’s the lying. Flynn’s insistence — to the press, and most notably to Vice President Mike Pence — that he didn’t talk about sanctions at all was clearly false, one of those “Flynn facts” his old subordinates liked to joke about. Flynn’s reputation as prone to inaccurate assertions was well-known before he joined Trump’s transition, and it shouldn’t have been hard to predict this kind of scrambling lie meant to cover up misconduct.

What’s more, Trump and his team didn’t need to predict it. They knew about it as of late January, when acting Attorney General Sally Yates warned them that Flynn had lied about the content of his communications with the Russian ambassador, and that this left him susceptible to blackmail by the Russian government.

Upon hearing that, any responsible president would have immediately fired Flynn.

Trump, instead, kept Flynn on his team, only firing him after word of Yates’s warning leaked to the Washington Post. He continued to employ someone who he knew was lying to his vice president, and who was at risk for blackmail by a foreign government. Trump has no one to blame for that but himself.

Trump’s other recent blowups are all own goals

So that’s Flynn. What of the other damaging leaks Trump has endured over the last few days? There was the leaked photo of him and Japanese Prime Minister Shinzo Abe reviewing documents about North Korea at the terrace of his Mar-a-Lago Club in Palm Beach, Florida, in full view of guests to the golf resort and with Trump’s aides illuminating the documents with their smartphone flashlights (an almost comically reckless security failure, given that their smartphones are also hackable cameras that foreign governments like North Korea and China could use to read the documents in question).

Who leaked that incredibly damaging document? Why, it was Mar-a-Lago member Richard DeAgazio, who photographed the proceedings and posted them to Facebook for the whole world to see:

And why did Richard DeAgazio have a front-row seat to this key moment of presidential and prime ministerial decision-making? Why was he able to photograph it and inadvertently let North Korea know about this security vulnerability? Because Donald Trump for some reason insists on conducting national security business at his golf club with random golfers around. The fundamental failure here is that Trump is completely clueless about how to do presidential work in an even remotely secure or professional fashion. That is no one’s fault but Trump’s own. The leaker is almost irrelevant. What’s important is that Trump made leaking trivially easy.

Same goes for the leaks surrounding White House Chief of Staff Reince Priebus. The main leaker there is obvious: Trump’s friend and Newsmax Media chief executive Christopher Ruddy, who stated on the record to the Washington Post and CNN that Priebus is "not giving Donald the pushback that he needs," and "doesn’t have the gravitas that Donald would respect at the end of the day."

There are so many ways in which this is Trump’s personal fault:

Why is Trump speaking with Ruddy, knowing that Ruddy is the kind of person who’d go and comment on the record to multiple outlets about internal administration discord? If Ruddy is, as appears likely, just repeating what Trump told him privately, why did Trump tell him that privately? In what sense is it Priebus’s fault that Trump doesn’t respect him, or that Trump is incapable of making good decisions without a more sensible person in the room providing “pushback”?

Trump wants to know why so many leaks are happening, why his administration appears in the press to be in such disarray. The glib answer is that it’s because his administration is in incredible disarray. But the ultimate problem, the ultimate reason everything is going wrong, is Donald Trump himself.

Watch: Michael Flynn resigns