Running away from your duty out of spite cannot be compared to leaving your king and the Grey Wardens to die on the battlefield, attempting to kill the remaining survivors, selling elves into slavery, allowing Arl Howe to torture innocent people, ignoring the blight, and so on. One could call Alistair a traitor to the Grey Wardens, but not Ferelden. And he certainly doesn't deserve death for it.
Abandoning your duty out of spite doesn't compare to abandoning your duty to your king in favor of duty to your country?
So naive. Had Alistair did what he did in any medieval society, he would have been executed as a deserter. Had he done what he did as part of a Roman Legion, he would have been executed. Not only that, but he would be fully expected to fall on his own sword himself, as oathbreakerand losing his honor. And had he not been executed as a deserter or contender to the throne, just as in Awakening, you open the gate for more desertions, and desertions will break an army.
Ideals, beliefs, solid values, these are all well and good. But too much of them, being blind to all beyond your own desires and emotional allowances, condemns you to foolish decision making and being unable to make the most prudent decision regarding various situations. Being blinded by the ideal of jusice for Cailan and Duncan makes you blind other viewpoints.
Regard or disregard Loghain's actions after Ostagar, every noble who fought him, every one, was also equally guilty of the crime you accuse him of, betraying the rightful ruler of Ferelden, in this case, Cailan's widow, Queen Anora. Even Teagan acknowledges her right to the throne in that first landsmeet. To condemn Loghain of betraying the throne is to also condemn Teagan once Cailan was dead and Anora now ruling.
Trust me, you won't find anyone here in the forums defending Loghain's alliance with Howe, save in roleplaying or sheer pragmatism in regards to how much land and power Howe controlled after Ostagar, and even then those people acknowledge the man is a snake. Nor will you find anyone defending Loghain of selling elves to slavery.
But you're foolish if you think sparing Loghain at the Landsmeet also means forgiving him and letting bygones be bygones, as is the case throughout the game when recruiting others. It may very well be you want a strategist. It may be you want to give more weight to Riordan's word over Alistair's as the senior Grey Warden and an old friend of Duncan's. Or you may want Loghain to lie in the bed he made, and serve forever in the very order he tried to destroy, or find some way to restore his honor.
But know this, joining the Wardens is not an honor, it's a death sentence. A prolonged one should you survive the Joining, but you are condemning yourself to become a high-functioning ghoul, who will ultimately find their way to the darkspawn, or the darkspawn to them, the taint destroying you from the inside out, and being forever connected to the darkspawn and the archdemons. And if you roleplay a believer in the Chantry, the Warden who slays the Archdemon will never find their way to the seat of the Maker because their very soul is destroyed in the act of slaying an archdemon.
From what I infer, and tell me if I'm wrong, you say Alistair is guilty of desertion, abandoning his country to death and destruction should the Warden, Loghain, and Riordan fail to get to the archdemon and slay it, but is not deserving of punishment, the men who betrayed their Queen also equally innocent of their role in the civil war and should also be spared blame, but Loghain and Howe, by virtue of Loghain abandoning Cailan at Ostagar despite making it clear time and again that the front lines were too dangerous for him, Loghain is deserving of a traitor's punishment, but Alistair in turn is not?