The Real Reason George Lucas Made Luke and Leia Twins in Return of the Jedi
Leia and Luke becoming twins wasn't always planned, but the revelation of their relationship became one of the most memorable scenes in Star Wars.

Luke and Leia were established as twins in Return of the Jedi, but there's more to the backstory of their connection than meets the eye. Relationships between characters may be a staple of Star Wars, but their connections aren't always planned. Before The Empire Strikes Back planted the seeds of their family bond, A New Hope established the idea of their mutual attraction, which was finally confirmed in episode six. The fact that having Leia and Luke having a relationship wasn't originally planned is well known, but the context of the retcon is murkier. However, 1997's Star Wars: The Annotated Script provides insight into how the twist affected Episode VI.
In the book, George Lucas reveals that while writing the return of the Jedi throne room scene, he struggled to come up with something to irritate Luke so much that he lost control while fighting Darth Vader. The creative struggles ran alongside the notion that Leia was Luke's sister. It made Lucas realize that the prospect of Vader turning his sister into the dark side would make Luke lash out like he did. Thus, the nascent notion that Luke and Leia are siblings provides a major emotional punch to Vader and Skywalker's climactic battle.
Luke's Relationship With Leia Was Important For The Throne Room Scene

Although Leia becomes Luke's emotional driver during Luke's duel, she materializes relatively late in the creative process, serving as the perfect catalyst for her brother's catharsis. Luke traveled to Darth Vader and Palpatine to rescue his father in Return of the Jedi. And, as he says in the throne room scene, he has no intention of fighting the fallen Skywalker. So, as mentioned earlier, the sequence needed something that would convincingly take Luke through the violent transformation he's undergone, which would in turn heighten the emotional gravitas of that moment. This is where Leia is crucial, as Lucas detailed in the script notes: He charges at Vader, and his attacks are no longer precise or well-thought-out. The hero swung his lightsaber in rage, trying to kill the very person he was trying so hard to save. This sequence makes it possible for Luke Skywalker to succumb to the dark side, and ultimately demonstrate his virtue when he resists his violent urges. It's a pivotal moment for a character that might not have been the same without Leia as its indirect catalyst.
"In the end, I had a problem in the fight between Luke and his father of why [Luke] makes the final turn to the bad side of the Force and tries to kill his father. [Director Richard Marquand] was trying to block out the fight between Luke and Vader, and we got down to that point underneath the throne room there, and he said, 'You know, the script sort of says that Vader says something that upsets Luke,' or something vague like that. [...] And we didn't have that actual moment that we needed where you got the sense that Luke is hiding. He's not going to fight him. [...] He'd rather die first, and then, something turns him around and makes him fight. [...] And in the process of evolving the script and evolving the importance of Leia as the sister, it was sitting right there in front of my face, and it became obvious that turning her to the dark side would be the thing that would set Luke off again."
Despite its importance in the Star Wars mythology, Luke and Leia's relationship is often seen as contradictory to A New Hope and The Empire Strikes Back due to the film's suggestion that Luke is attracted to Leia, in which The biggest one is their infamous kiss in episode five. However, while their family connection did develop gradually over the course of the original Star Wars trilogy, the twist still fits with the lore established in the first two films. First, the heroes don't know they're connected as evidenced by their lack of mastery of the Force when they realize they're twins when they meet.
Luke & Leia Being Twins Fit With Star Wars Lore

Second, their family relationship is heavily hinted at (possibly unintentionally) in the third act of episode five. After fighting Vader, Luke hangs from below Cloud City and calls out to Leia through the Force, who senses and quickly finds him. While this scene may not have been meant to hint at their bromance, it ended up being a very fortunate case of retroactive continuity. So while it wasn't planned that Luke and Leia were twins, and while some things seemed to contradict what was revealed in Return of the Jedi, the characters' backgrounds and hints from Episode V made their connection fit Star Wars lore.
Next post: The Last Jedi changed Luke Skywalker in the original trilogy in various ways