Of all of Marvel's vaguely defined villains, Nebula was always more of an opportunist than a straight-up believer, which is why her changing sides in Guardians of the Galaxy Vol. 2 works. But, according to Karen Gillan, Nebula wasn't even supposed to be alive to switch sides.
Image: Nebula in Guardians of the Galaxy Vol. 2 (Marvel/Disney)
Digital Spy interviewed Gillan, who revealed, "I definitely had a feeling that there was room for the character to expand in the future, but she was originally supposed to die in the first movie, I think I remember in the script."
She probably means the script written by Nicole Perlman, which James Gunn changed a lot of when he was hired to direct. We know that Gunn's original ending for the film removed any ambiguity about Nebula's fate, showing a disgusted Nebula walking away from the battlefield. If Nebula was slated to die, it must have changed way before they shot the film.
It's also interesting because a character originally slotted to die is not only playing a part in the second Guardians, but is also one of the many, many characters set to show up in Infinity War. She isn't a one-off villain or henchman, which she could have easily been.
Part of that is certainly that her anti-heroism, rather than being straight-up evil, gives her more dimensions to explore. Another aspect is surely her connection to Gamora as "sisters", which, as Gillan said, means the movie gets to "explore all these amazing things about her past and her relationship with Gamora".
If nothing else, hopefully Nebula and Loki get together in Infinity War to commiserate over being disgruntled siblings.