WASHINGTON — President Trump is a man seriously susceptible to snagging himself in the nettles of obsession. In the last three weeks, no compulsion has so consumed his psyche, and his Twitter account, as the deeply held and shallowly sourced belief that President Barack Obama tapped his phones.

So why can’t he just let go?

First, aides say that Mr. Trump, who often says, “I’m, like, a really smart person” in public, is driven by a need to prove his legitimacy as president to the many critics who deem him an unworthy victor forever undercut by Hillary Clinton’s three-million-vote win in the popular vote.

“The Russia investigation is being used by his political opponents to delegitimize his entire presidency and to delegitimize his agenda,” said Sam Nunberg, a longtime Trump political adviser who remains close with West Wing aides. “He will fight back, and he does it better than anybody in this White House. And that includes all those Republican National Committee guys he hired to defend him.”

Second, fighting back — in this case, against Mr. Obama, the F.B.I. director and members of his own party who say his claim about phone taps is false — is an important part of the president’s self-image. The two most influential role models in Mr. Trump’s youth were men who preached the twin philosophies of relentless self-promotion and the waging of total war against anyone perceived as a threat.