Okay fair, he doesn't outright hate them, but the way this protecting his masculinity manifests, like characterising his time with the okama as a hell, or objecting to getting a blood transfusion from two of them, are all things that would considered extremely hurtful if I pulled that shit with any of the queer people I know.
As socially engaged individuals, we tend to be very cautious/sensitive regarding some topics. It must be bad that Sanji's time with the okama was hell for him, right? Maybe. However, can we justify Sanji's feelings in the context he was inserted in in order to better understand it? I think we can do that. Those years were hell for Sanji mostly because there were no women in Kamabakka. Zero. None. That's actually pretty harsh, even more so for a character known for his over the top passion for women. Then you add to this the fact that Sanji's gender identity was being constantly contested during that whole time and you can understand how stressful was his situation. It's a very particular circunstance and a very extreme one, so I don't think you can pull any of that shit with your gay/queer friends because you don't have any reason for such reaction. Even then, it must be pointed out that, despite his trauma, Sanji never dismissed the value of the okamas as people, since he CHOSE to stay there and he proudly cooks the 99 okama recipes that he's learned. And I repeat that all of this is coming from a character that had showed to be chill around okama before back in Alabasta.
Sanji isn't hateful, I'll pay it, but his views are outdated and again, Oda sees it as a quirk, but it comes across to more people as a flaw. And when you have a character with glaring flaws that hold them back and cause them to act hurtfully to their friends but the narrative doesn't portray it as something that needs to be changed or worked on you get this dissonance between the story and the readers.
IMO, Sanji is portrayed as a flawed person. His chivalrous quirkness is constantly seen as idiotic by other characters or the narrative, he's made fun of, he's not taken seriously, he's downplayed by women, he gets in bad situations because of his attitudes, many circunstances question his values, so basically everything in this regard comes with a thousand red sirens screaming PROBLEM, PROBLEM, PROBLEM. I believe Oda has even made fun of how fragile is Sanji's masculinity. That's what it is. For some time now, many readers complain of how much Sanji became a comic relief because of his chivalry, so it baffles me the perspective Sanji's nature is only seen as praiseworthy in the narrative. By the way, masculinity is something constantly played for the laughs in One Piece for how silly it looks, not only because of Sanji himself, but think of Franky's and Señor Pink's ridiculous fight of manliness.
The fact that Oda doesn't change Sanji doesn't mean that the character is not portrayed as flawed. Therefore, the choice of keeping Sanji in his core characterization must not be seen as a social statement. He's just what he is. He doesn't change for reasons that we can't even speculate properly. In the end of the day, all the Strawhats have fixed flaws that are played for the laughs or other convenient uses, but we demand that Sanji in particular develops asap only because of our own personal agenda.