This, conversely, meant that most of them would either die or be punished by the end. For a good while, it was because the Depraved Homosexual trope and its ilk pretty much limited portrayals of explicitly gay characters to villainous characters, or at least characters who weren't given much respect by the narrative.
The reasons for this trope have evolved somewhat over the years. Indeed, it may be because they seem to have less purpose compared to straight characters, or that the supposed natural conclusion of their story is an early death. In aggregate, queer characters are more likely to die than straight characters. In this way, the death is treated as exceptional in its circumstances. This trope is the presentation of deaths of LGBT characters where these characters are nominally able to be viewed as more expendable than their heterosexual counterparts.