LGBTQ people will pilot spaceships, colonize planets, battle aliens, invent warp engines, and discover all sorts of intergalactic weirdness. So of course there should be great science fiction stories about them.
In the list below, some books focus on sexual identities as a major theme, while others just have a gay character or two. I won’t usually spell out which books are which, because that has the chance of spoiling a plot point, and I’d hate for that to happen.