There is no rational reason for President Donald Trump to continue attacking the late Sen. John McCain — so why does he do it? In the past few days the president has hammered the former statesman for being weak on veterans, “badly hurting the Republican Party, badly hurting our nation and hurting many sick people.” He also complained that he “never got a thank you” for giving McCain the funeral he wanted. Through it all, his staff cringes, elected Republicans grimace and condemn, his strongest supporters get uncomfortable and evasive. Nevertheless, he persists.

The two politicians differed on many issues, domestic and foreign. But the depths of Trump’s resentment seem to extend beyond a typical political rivalry. Trump can’t let McCain rest in peace because on some level, conscious or subconscious, he fears he will not be remembered as a great man — or really even a good one.

Trump can’t let McCain rest in peace because on some level, conscious or subconscious, he fears he will not be remembered as a great man.

The late senator’s famous “thumbs down” gesture during the heated 2017 vote over Congress’s “skinny repeal” of Obamacare gave the president his first major legislative defeat. Clearly, years later, the moment still stings. Ending the faltering “repeal and replace” effort at that point probably saved Republicans from a greater political disaster in last year’s midterm elections, but it should have been followed — as McCain suggested at the time — by a new effort to repeal Obamacare and replace it with legislation developed and passed through regular order, with committee hearings and markups.

Trump seems more eager, though, to complain and play the victim than to do the hard work of developing and advocating for a conservative policy solution on America’s very real health care issues. This has been true for health care, and it’s also been true for many other GOP policy challenges and Trump campaign promises.

McCain was also the most stalwart defenders of the post-World War Two international order, advocating for a strong NATO alliance, a robust U.S. military presence overseas, and victory in the long wars in Iraq and Afghanistan. Trump sees much of that as a mistake — a waste of time and money that drains America’s coffers and costs jobs here at home.

Perhaps more critically, McCain was among the strongest opponents in the Senate of treating the President Vladimir Putin’s regime in Russia as if it were a legitimate and normal nation. His support was critical to the bipartisan passage of the Magnitsky Act, which subjects Russians suspected of human rights abuses to sanctions and bans on travel to the United States. Trump, for reasons known only to God — and, perhaps, Robert Mueller — is keenly interested in exactly the opposite: normalizing relations with Russia, and explaining away Putin’s aggression and misdeeds.

Finally, there is the contrast between the life McCain led, and the legacy he left and the life and legacy of the president. McCain led a life of dedicated and heroic public service. As a naval aviator, a prisoner of war, congressman and senator, he always put, as his 2008 presidential campaign slogan put it, “country first.” The president, on the other hand, avoided service in the Vietnam War entirely using means that… well, I think it’s fair to call him a draft dodger. He then parlayed his inheritance into celebrity, the slick and gaudy appearance of success in real estate, ghostwritten books, and eventually television stardom.

At roughly the time John McCain was enduring five years of torture and abuse as a prisoner of war in Hanoi, Donald Trump was cruising Manhattan in a limousine with his initials on the license plate and buying cocktails for models in the Peacock Alley bar at the Waldorf Astoria hotel.

What historic figures do in life echoes in our nation’s memory of them. When John McCain passed away last year, he was buried with honor, and with the respect and affection of grateful nation. The end of his story is still yet to be written, but perhaps Donald Trump doubts the same will be true of him when his time comes. I think that’s why the president can’t seem to let this pointless, destructive and distasteful one-sided feud go. He seems haunted by the ghost of a better man.