Part of it comes from historical depiction of homosexuality/non-straightness in Hollywood-movies, that started with purely subtext (you can't have a lesbian on screen, but you can have a female vampire implying sexual violence to another female).
Bit by bit, things opened up from "only subtext" to acknowleding that gay people exist, but are pathetic, devious, pitiful and fundamentally predatory. Somewhere in his era developed a popular depiction of gay people - especially of gay men - getting humiliated, beaten and threatened by a character (sometimes by the main character of the film).
But since gay people still couldn't be fully formed human beings with complex inner lives on-screen - and instead followed the above characterization of being inherently devious and "other" - frequently responded to this kind of abuse as if it was a consensual S/M situation, giving the abuser compliments while being abused, when the actual context allowed for nothing of the sort as a plausible "thing".
Some of that regressive portrayal of homosexuality is still hanging around by way of tropes, and - perhaps - also reinforced by a weirdly "pseudo-woke" way of writing gay characters as tragic characters (if not outright "saints", in the sense that the more abuse they get put through, the more excellently, transcendentally human and kind they become. Characters who are written like this rarely, if ever, complain about their mistreatment, opting to instead just "be brilliantly poised in their suffering").
This kind of writing is obviously trash, but its conventions has roots that stretches back to the beginning of cinema (with many mutations along the way).
"The Celluloid Closet" is a pretty interesting documentary about LGBTQ-depiction in Hollywood. It doesn't necessarily dig directly into this train of thought, but it's a pretty good starting point for anyone who is curious about getting a brief primer on Hollywood and depicting LGBTQ characters (without attending a more in-depth, academic course).
It is available for free on Youtube, and can be seen by clicking this link.