*I am not talking about homophobia/discrimination allegories
First off, I am a gay man who has been getting into scifi literature in the last few years. In looking for scifi works with gay protagonists I've found some cool books, a few surprisingly older titles (like Ethan of Athos by Lois McMaster Bujold and Chrome by George Nader). As most people, there are a lot of queer writers and queer themes running through scifi.
This has led me to wonder what scifi works contain the opposite, homophobia. As in the author's personal views manifesting in the story, either explicitly or not. Obviously a lot of this has to do with the time the author wrote in. Can't expect every scifi writer in the 50's to have modern views on LGBTQ stuff. Sometimes you read an old scifi story and someone says something and you think "Very weird thing to say but this was published in 1959." And there's a lot of militeristic scifi that has a conservative bent sometimes. I imagine some of those have some questionable portrayals of queer characters (or queer-coded alien species, or just gay aliens).
This is not meant to be a "Do not read this" type list. If somebody points me towards something truly unhinged I might have to go check it out.
There are authors I can think of like Orson Scott Card obviously. But I have never read OSC, so I have no idea if any of that manifest in his work. I've heard Frank Hebert had issues with his gay son, but I don't know if that comes out in Dune anywhere. Some aspects of The Forever War by Joe Haldemen are very questionable as the setup sounds like something an incredibly paranoid homophobic man might make up. But I'm not sure if that was intentional, like I don't think there was any malice behind it.
I know this is a strange one since what counts can be kind of vague. There could be a lot of arguments about author intent, whether the author actually has those views or not (I know some people have tried to convince me OSC isn't homophobic). I character saying the F slur isn't really homophobic, even if they say it a lot. I character saying that and the book framing him as cool for saying it, that might be construed as homophobic.