The USSR recriminalised homosexuality under Stalin, a law that was only repealed after the dissolution of the USSR. It was only legal just after the October Revolution in 1917, but it unfortunately did not last long (in 1933 it was recriminalised). In 1927, the USSR labelled homosexuality a disease and a mental disorder. Under Stalin homosexuality was associated with facism, including warnings about a "counterrevolutionary fascist homosexual conspiracy" used to justify arrests.
Homosexuals were described by the Soviet government as fascist, pedophilic and it was associated with prison rape. Soviet legal scholars deemed it inconsistent with "Communist Morality".
There have been Marxists who put forth compelling arguments why LGBTQ rights should be respected under communist theory, but those largely fell on deaf ears. A modern theorist is likely to be in support.
I hate to say it, but in recent years LGBTQ rights have been best protected in western and northern Europe, Canada and Australia, with the situation improving in Brazil and Argentina for example. These are by and large capitalist countries.
I personally don't think the ideology matters all that much here though. It's mostly religious conservatism holding back LGBTQ rights (see Africa, the ME, Indonesia, Russia and the US/Latin America).
Also happy pride month! ๐. Let's keep fighting for each other's rights ๐ช