Loghain's motivations are understandable. He didn't know it was an actual invasion, it wasn't confirmed yet, we only ever confirmed it after getting those dreams. Sure, Duncan had a hunch, but handing over your entire country (from Loghain's point of view) over a hunch is not justifiable. The problem is how he was handled afterwards, they tried to skirt around a bit and portray him as not a paranoiac, but since nothing was even hinting at his presumed eventuality, he did come across as irrationally stubborn. Humans don't always act rationally, but that's not the problem, the problem is that they didn't go anywhere with him. As time went on, he kept losing whatever depth could've been be squeezed from him because it was made clearer and clearer the French aren't even part of this game. If you make him a Gray Warden, he kinda admits he was wrong, but so what? That doesn't make for dramatic storytelling, it only made it so he isn't a lost cause psychologically. Loghain should've been the main story, with the Blight occurring in the background, not the other way around. Him trying to hold onto power and discipline while the Blight became more and more inevitable.
I think that was their original intent, or perhaps wanted to do something with this. All this political maneuvering Anora was doing stroke me as build-up for that, with Alistair as a sort of surprise reveal that might shake things up a little. It sounds a bit soap opera-y when I put it that way, however, and it would've required quite a deft hand to do this kind of story justice, so they went with the more simple narrative in the end. It was too simple, though, and it came out Disney-esque, with clear roles for everyone from a meta storytelling perspective. Loghain is the crazy guy, Anora is the manipulative bitch, Alistair is the good guy who we root for for king, the end.