I've been wondering about this too. Besides the good answers given here, I suspect / speculate that it also has to do with a national pride after the opium war. Even though China didn't manage to fully shake off the corruption of the elites then or now, there is a strong desire to make the country better and to invest in education, research, prosperity and healthcare. Because that was how their enemy the British Empire beat them. Like they believe in something other than money.
They also avoided entering an arms race with the US. Maybe they were (seen as) less ideological. They saw themselves as Chinese instead of "Sovjiets".
Then you also need to be clever with how to deal with foreign propaganda influence. You can't have a free press if you're on the US radar.
Maybe the answer is as simple as "they had better / stronger leaders" while USSR was too repressive / purged any opposition.