Imagine the agony of Paul Ryan now.

On Monday the House Speaker, America’s top ranking elected Republican, said he would never again campaign with or for Donald Trump and would no longer defend him, in the wake of the now-infamous video released last Friday. But, Ryan said dissonantly, he was not withdrawing his endorsement of Trump.

Was he being hypocritical? Cowardly? Commentators on the left and right quickly said so. But before condemning Ryan, let’s think about the cruel dilemma he faces. It’s of a type that confronts many top-level leaders.

For seven months Ryan has been writhing in his struggle to reconcile his obvious loathing of Trump with his responsibilities as the country’s top Republican. Ryan is clearly appalled by about 80% of everything Trump says and would presumably love to say so. His failure to do it has been branded as weakness, an unwillingness to choose the painful but honorable course when confronted with a difficult choice. The Harvard Business School’s Gautam Mukunda argued this view explicitly in a valuable article on beliefs vs. values at the Harvard Business Review’s website last summer.

But in a case like Ryan’s, this line of argument omits an important element. Ryan holds limited authority over all the Republicans in the House, where they are the majority. If we do him the courtesy of assuming he wants what’s best for the country, and that he sincerely believes mainstream Republican policies are generally best, then he rightly wants to preserve the Republican majority.

For him, denouncing Trump isn’t analogous to a CEO firing a manager who produces good results in bad ways; Ryan isn’t CEO of anything, and he can’t hire or fire officeholders (let alone Trump). Denouncing Trump could antagonize millions of Trump supporters whose votes are needed by Republican representatives, potentially surrendering his party’s control of the House. By doing so, he would have benefited no one whom it was his duty to benefit. Of course he could have resigned – he never wanted to be Speaker anyway – and then vented to his heart’s content. But that would have achieved nothing.

Sign up for daily insights, updates, and opinion on leadership and leaders in the news at the Power Sheet.

Yes, this type of argument – I would have been happy to sacrifice myself, but I owed duties to others – can by used to justify all kinds of malignant behavior. It can also be valid and honorable. In light of Ryan’s high reputation among legislators of both parties, I’m inclined to believe he isn’t being selfish or hypocritical in taking the tortured position he has adopted regarding Trump. I suspect he’s doing his best in an impossible situation, sure to be savaged no matter what he does. Part of a leader’s job is living with circumstances in which all of one’s alternatives are bad.