I wonder what kind of structures lead to the liberation of queer people.
Certainly, socialism hasn't significantly outpaced capitalism. You can point to pockets like east Germany, but overall the socialist block hasn't been great on the issue. For the examples that look good, (Cuba, and China's improving) I think the factor has to be time rather than socialism.
Even in pre-colonial times, things weren't good. I'm reminded of the goddess Ishtar who represents (what we perceive now as) queer people, but the myth acknowledges that queer people were cursed to live on the fringes of society. So, while they weren't demonized, it seems to acknowledge that they weren't really welcome in mainstream society either.