as for loghain betraying Cailin to his death.
Merik made Loghain swear to him to defend Feralden regardless who was in danger.
rules of warfare:
1: unless you as king are a competent tactician, listen to your generals and let them lead the battle.
2: Chose your battlefield and make it your own. Failure to do so will cost you victory or make your victory very costly.
where Cailin lost his life of his own doing was not chosen it was just where he said they were going to fight them. He did so with out consorting with his generals and even refused Loghain's word when he said it would fail.
Loghain was loyal to FEralden, so was The Usurper King Cailin. The only difference between the two, is Loghain was no fool and Cailin certainly was.
had Loghain followed Cailin's plan. then there would have been no army later on when the old god came callin and all that would be is a rag tag squad trying to break the hordes of Darkspawn with only loose nit allies.
Say what you want that Loghain is a traitor, but Cailin was a pompous fool with wet pipe dreams of grandeur.