Loyalty is an essential human motivation that has always played a major role in fiction. Divergences between different logics of loyalty, as between friendship and family, or between military duty and personal faith, are major power sources for compelling plot and character.
So why has every recent science fiction or fantasy movie I've seen not only ignored any possible conflict of loyalties, but seemingly denied the very existence of loyalty as a virtue, or even a meaningful personality trait? Note that I don't see a lot of SF movies, except when accompanying offspring.
District 9 I've gone off on before. But to summarize, Wikus, a resettlement bureaucrat, has an evil job. That's not so bad, even a good setup for some personal growth. Something awful happens to him. In his struggle for survival, he kills many of his former office friends and colleagues, without any sign that this has any effect on him at all. Then he betrays a new friend and kidnaps that friend's son in a desperate attempt to save himself. He does miss his wife, so he betrays only two of three of his loyalties. The new friend is the worst, because it sits right at the narrative spot where Wikus would build a new connection and find his true loyalties--but his loyalty remains himself.
In Avatar, Sully, a former marine turned mercenary, bonds with two other former marines turned mercenaries: his commander, Col. Quaritch, and a tough female pilot, Chacon. That they are all mercenaries, not serving military officers, does make some of the subsequent betrayals easier to understand: mercenaries certainly have loyalties, but they often get chewed up in the incompatabilities between the military and commercial ethos. (Mercenaries are popular heroes of a certain type of SF I used to really like to read, but it was implicit in those stories that military ethics are superior to commercial ethics, a point I'd rather see argued than asserted. In Avatar, both are found wanting.)
Sully falls for the native people the military force was hired to eliminate, and turns against his former colleagues. He switches his loyalty to the Nav'i, and works to fit into their status hierarchy. Plot spoiler here. Once he switches loyalties he and Chacon kill many of the mercenaries, without any sense that either of them ever cared about or was friends with any of the people they served with.
Of course, Sully's grotesquely incompetent military decisions lead to the deaths of huge numbers of his new buddies as well. Pyrrhic victory comes, but just barely, and through luck. His new tribe properly should hang him from the nearest giant glowing tree once all their dead family members are sent on to the Great Server. But that's another story.
But at no point is there any conflict of loyalties, despite the fact that the human race seems to be facing some gigantic crisis that the mining company and mercenaries are here to help solve, however corrupt and incompetent they may be at it. These are desperate people, and desperate people don't usually behave well. My children liked it.
Finally Tim Burton's Narnia remake, Alice in Wonderland. Alice is the young unmarried daughter of an impoverished widow in late Victorian Britain. She is slated to be engaged to a dim but wealthy man. In case you were wondering, that's actually the happy ending of many novels of the period, but here it starts things off.
Within Wonderland Alice herself has no problems of loyalty. But consider the bandersnatch, serving the Red Queen. His loyalty is easily turned: just give him back the eye that got gouged out when he was trying to capture you. You'd think a beast like that would at least have the virtue of devotion to duty.
Then, when Alice returns, all is well. Despite the fact that she has learned nothing and brought back nothing from her adventures, she can dispense with marriage, with family, and with everything else, and make her fortune the way late-Victorian adventuresses so often did: by finding China on a map. "Yes, just look on the other side of the fold". Why didn't she just decide to discover America? This is too dumb to be called a spoiler.
But now I'm whinging on something else altogether. I'm not saying that the loyalty you are discarding is right, or deserves to be kept. Should Alice give up a chance at happiness and marry a wealthy but tedious lord so that her mother doesn't end up in the workhouse? Should Sully help despoil Pandora so his own race can survive? Should Wikus let himself get killed just because he has a honking ugly but magic hand?
Hey, it's fiction, there are no wrong answers. But do you value a character who does not show loyalty? I'd never thought about what an important personal virtue that is until I saw its lack. Is it any wonder than none of these characters have close personal friends?
As a writer, all I can do is the opposite.