Has anyone in our public life cultivated an image of personal heroism more meticulously than Arizona Sen. John McCain? Soldier's son. Prisoner of war. Torture victim. Ideological maverick. Proud patriot. Honest broker. Champion of the troops. Captain of the Straight Talk Express. Bipartisan truth teller. Advocate for the honor of service and the nobility of sacrifice for a cause greater than the self.

Like pretty much everyone not named Donald Trump, I've long been moved by stories of McCain's suffering in Vietnam and by his seeming candor and courage in politics over the years. But I've also grown weary of seeing him treated like some kind of secular saint when his record over the past decade has mostly been a profile in self-serving cowardice. Again and again, McCain has placed his ravenous personal ambition ahead of the good of the country. In the process, he's done as much as anyone in his party, and far more than most, to advance the cause of the venomous populism that's now taken hold of the GOP.

John McCain, hero? Hardly.

McCain has an admirable distaste for factions of the Republican coalition that peddle poisonous conspiracy theories and actively slander those on the opposite side of the partisan divide. I share that distaste. McCain's willingness to distance himself from those tendencies — calling Pat Robertson and Jerry Falwell "agents of intolerance"; daring to describe Barack Obama as "a decent person" before a rabidly right-wing audience — has always been one of his best qualities.

But it turned out that McCain wasn't so opposed to this sordid way of doing politics that his 2008 presidential campaign swore off such tactics entirely. On the contrary, McCain simply sought to outsource it — to running mate Sarah Palin.

McCain has received far too little blame for single-handedly launching Palin's national political career. There would be no Donald Trump sitting at the head of the Republican Party in 2016 if McCain hadn't chosen Palin to serve as his prospective vice president. That choice placed a cultural populist in the national spotlight for the first time since the era of George Wallace and gave a restive faction of GOP voters a taste of something they would demand with ever-greater intensity over the next eight years: a tribune who would run a campaign fueled entirely on toxic rhetoric and resentment.

That may well end up being McCain's most enduring contribution to American political life, all because he was too high-minded to avoid the political gutter himself — but not high-minded enough to stay out of it altogether.

In the years since McCain-Palin ticket went down to defeat, McCain has tried, and often failed, to keep walking the same fine line: portraying himself as an honorable old soldier and paragon of civic decency while periodically slinging partisan sludge with the best of them. President Obama brought "absolute humiliation" on the United States by negotiating the Iranian nuclear deal, McCain said. The president was also "directly responsible" for the Orlando mass shooting and "allowed" the terrorist attack in Nice to take place.

And then there is the most astonishing development of all: McCain's endorsement of Donald Trump in his quest to become president of the United States — despite Trump's ridicule of McCain, 10 months prior to the endorsement, for managing to get shot down and captured by the North Vietnamese during the Vietnam War.

That endorsement has stood, through Trump's embrace of positions on foreign policy and immigration that McCain considers outrageous, as well as through Trump's vicious verbal assault on Judge Gonzalo Curiel in explicitly racial terms and his equally relentless attacks on Trump critics Khizr and Ghazala Khan, the parents of a soldier who died in Iraq. In the latter two incidents, McCain rose in defense of those on the receiving end of Trump's abuse — with a tweet in the case of Judge Curiel and a lengthy and moving statement in the case of the Khans. But the endorsement itself hasn't been withdrawn.

Why on Earth would a man supposedly motivated so profoundly by a sense of honor lend his good name to a political campaign he must find both morally repulsive and extraordinarily dangerous to the U.S. and its allies around the world?

The answer is remarkably simple: McCain is up for re-election this year and desperately wants to keep his job.

That's right: The great hero would rather back a patently unacceptable presidential nominee than risk antagonizing a faction of voters who could force him to retire from the Senate, at the age of 80, after five six-year terms.

You can be a paragon of fortitude and courage or you can be a power-hungry party hack. But you can't be both.

Very few leading Republicans have come through the rise of Donald Trump looking good. But no one has ended up looking worse than John McCain.