Loki does not “betray” his family over and over (despite what a certain actor and his director buddy seem to think).
He was betrayed BY them.
Betrayed by Odin, who kidnapped him, lied to him, and raised him to hate his own race.
Betrayed by Frigga, who went along with Odin’s deception and was more concerned with keeping the peace than in standing up for her emotionally vulnerable son.
Betrayed by Thor, who treated him as a servant and belittled him in front of their peers, refused to listen to him, and never asked once for Loki’s point of view, or what happened to him.
As a child, he was quiet, curious, and bright, NOT obsessed with stabbing (he’d never been obsessed with stabbing).
People like to forget that Loki’s behavior from the vault scene in Thor 1 through the rest of his MCU run is the result of a huge mental breakdown from which he had NO ONE to turn to. To say nothing of a 1000+ years of being ostracized. He deeply loved his family and wanted nothing more than to make them proud. Which, you know, would be really hard to do if he betrayed them constantly. Then he finds out his entire life, and his place in the family, is a lie. And it breaks him. His actions from then on are a departure from his usual conduct, not the norm. Yes, he can be cunning, manipulative, and ruthless, but it’s not his default. Watch the deleted scenes from Thor to get a sense of how he was before the truth came out.
Yes, he was guilty of ruining Thor’s coronation. But Thor was in no way shape or form ready for the throne, so Loki dealt with it in the only way he knew would work. Why? I have to imagine Loki knows he’ll be dismissed if he speaks up himself, and he’ll just be labelled as jealous or untrustworthy (as we saw with the W3 and Sif). He probably learned long ago that resorting to subterfuge was the only way to get his points across, no one listens when he makes a point himself. He never intended for the fallout to be Thor getting banished.
Also, Thor is not a cuddly golden retriever or whatever people are saying these days. He was a bully, and he more or less stayed a bully.
It’s super weird to me how fanon seems to view MCU Thor and Loki as polar opposite from their actual MCU canon personalities.