What a great question, and thank you for asking!
So in college I took this class called Gays and Lesbians in Film, better known as Spot the Gay. The class was structured entirely around watching movies and pointing out the queer characters, then we wrote papers explaining why we thought they were gay.
The idea of queer coding is that censorship laws dictated homosexuality couldn’t be portrayed in movies, and thus filmmakers had to sneak it in with hints of characters so that the gay audience could see them (but no one else could). This gives the notion of “coding” dual meaning: it refers to The Code (what they called the censorship laws), as well as creating a kind of language between the films and the gay audience. This is why I don’t buy into “gay interpretation” or the idea of “subtext” because often this coding is put in intentionally, to be read overtly, as actual text.
They did this by using stereotypes. The primary gay stereotype in the Star Wars universe is C3PO, who is the perfect portrayal of The Sissy, or the flamboyant/effeminate gay man who functions in the plot as the comedic relief.
Obi-Wan in the original trilogy is more subtly coded though, because his stereotype is generally portrayed by women. The Spinster character is usually reserved for lesbians, women who have been betrayed by those they love and opt to live in solitude. We generally meet Spinsters post-trauma, and they’re nearly always emotionally dissonant. Spinster stories tend to end one of two ways depending on their function in the plot: they find A Man and change their lesbian ways, or they get to die the way they lived—really fucking gay.
But the prequel trilogy has much more nuance for Obi-Wan to be queer coded because 1. he has more screen time and 2. the prequels defy most action movie storytelling conventions by introducing more complicated plots generally reserved for other mediums.
In TPM, Obi-Wan’s relationship with his Master Qui-Gon mirrors Greco-Roman pederasty, which is further supported by the epic Roman historic narrative of the prequels. And if that doesn’t convince you, there’s this:
I always lump together AotC and RotS because they essentially function as one story. In these, we see the relationship of Obi-Wan and Anakin. Regardless of whether or not Obi-Wan’s feelings for Anakin reflect his feelings for Qui-Gon, there are still clear indications of gay coding, namely The Metrosexual. Think, “So uncivilized,” and his high-strung nature that is so often associated with gay men.
Think, too, his articulate and sharp criticisms, his emotional reservation, his dry wit—all common stereotypes of gay men, all frequently used in the history of film to code queerness. Even his disdain for flying could be symbolic of being afraid to get one’s hands dirty, one of the most anti-masculine traits a character could be given.
And as you mention, anon, “I loved you.” There is so, so much in those three words. Even if they were said bereft of romanticism, they are still said. They are said by a man with courage and conviction enough to say them. To dig straight to my point: a heterosexual man does not normally tell another heterosexual man, “I loved you” in film. It just doesn’t happen. They say anything but. They show affection with violence and bloodshed, and Anakin does that. Over and over, he shows that his only true touch is a violent one.
But Obi-Wan? He stops the fight. “I have the high ground,” he says. He ends the heteronormative trope of fighting over love, and he comes right out and says it. “I loved you.” He has the guts to say that, and that alone does not make him straight.
And for two hyper-violent white guys in a multi-million dollar commercial media production, they make a surprisingly feminist duo when coupled with my theory of Anakin as a female coded character (in a similar way to Obi-Wan being queer coded).
But now we’re back to the original trilogy, where, after seeing the prequels, we understand where Obi-Wan has come from. To put it bluntly, Obi-Wan has been scorned. By a man. The betrayal of a man he once loved destroys his entire life, which not only cements his Spinster status, but subverts him entirely as a masculine (read: straight) action hero. Action heroes (aside from Bi AF Steve Rogers) don’t usually get to be scorned by men. They don’t spend their lives pining, agonizing over their mistakes and their losses. Masculine characters don’t get to grieve, and they certainly don’t get to spend most of their lives doing it.
If you just watched the original trilogy, you would see Obi-Wan as the simple mentor sacrifice, little more than a plot device. But the prequels, as much as they’re loathed, create a (gay) nuanced, (gay) tragic (gay) character in (gay) Obi-Wan who defies the bounds of his static archetype.
tl;dr OBI-WAN KENOBI IS RLY GAY