It’s just political realignment. When the US is strong, we support the USSR. When the USSR is strong and threaten our interest, we support the US to keep the Soviet ambition in check.
The US was strong, and yet, the PRC sided with the US. Also, I'm not really sure how siding with the US in Afghanistan and attacking Vietnam helped the PRC or socialists in the world.
Also, I am going to note that it's not just the USSR whom the PRC aligned against, but national liberation movements of other countries that fought against colonialism.
The fact is that we’ve won
Has the PRC won, though? NATO is still up, in a dominant position, carrying out genocides. The allows of the USSR suffered massively from the loss, with many now being loyal vassals of the worst genocidal empire in the world.
I am also going to note that the USSR DID try to ally with the US. That led to a destruction of its industries, death of millions, and many more plights.