It requires a deeper understand of the communist model of the Human. Similarly the nazis, also the communists had an idealist model of the human.
The main critics against the communism is that it is not possible, because people requires typically strong motivation to be a cooperative and not a parasitic member of the society. In our current world system, this motivation is the money. The sad truth is that most of us wouldn't work, or would work much lesser or much different, if we wouldn't need to get money.
The idealized "socialist human" works because he wants his society to get to the communism. In the communism, they work on their ideals, and all of the dirty/unpopular work is automatized.
It is not true that the communists had false dreams, they knew this disadvantage of their ideals very well. Their idea of the communism also contained, that to reach this perfect society, also the humanity has to develop to a point which is compatible with it. Furthermore, they hoped to solve this essential problem by automation and industrial development, but also with the development of human race.
See that sculpture. Man and woman, symbolizing that they work together. Their position shows as if they are being part of a large, heroic battle, and that they are fighting this battle not with weapons, but with tools. With sickle, and with hammer. (The sculpture has also the secondary meaning, that the workers and the peasants are working together, in such a close cooperation like husband and wife.) It was also the coat of arms of the CCCP. The sickle and the hammer in its coat of arms, are the same sickle and hammer, as you can see on the sculpture:
In our current society which is likely governed by an idea to make the humans worser, but happier and equal, homosexuality is accepted, even encouraged by the ruling ideology, the liberalism. But it is not "natural development" of the modern societies, if you see the world history, you will find only a few of them who followed the same line and survived at least centuries after that.
Homosexuality was not a central point in it. They disliked it, but not because it had been a central point of their ideology. They disliked it because they wanted to create the perfect, "socialist human", and homosexuality is at least a sickness, a degeneration, far from the perfection.
This "socialist human" had also only a single wife, they had sexual relations only in the marriage, but against the non-planned parenthood advised by the religions, they had lived in a perfectly planned family model, in which the man and the woman are equal and both of them work.
In their view, homosexuality was a degeneration from this model, but it was not a central point. The central point was that they are atheist, egalitarianist and they work on their best skills as well-oiled pieces of the larger machine: the communist state. And, in exchange, they get from the state as they only need.
They had been also atheist. Some religious directions did exist in the communism, for example, Christmas had been changed in the Sovietunion to 7th Nov (the largest national holiday of the CCCP, the anniversary of the "Great Socialist Revolution"). Or Lenin had a mausoleum where everybody could wonder on his dead mummy. But, what is very important: these, quasi-religious practices were in theory not religious. They didn't imagine any "spiritual power" to Lenin's mummy or to their certificate of membership in the communist party, they had considered a terrible insult, that these are essentially religious practices (and, in some eras and countries, for example under Stalin, such a statement could have leaded from prison term to execution).
Making the communism friendly to the homosexuality, it hadn't been an essential change. They were hostile to that, because their era existed mainly before the current, liberalist world and as the world history shows, being a society tolerant to homosexuality and its century-long survival are mainly opposite things.