Therefore, the logic goes, each side needed to frequently show off their advanced technology whilst avoiding showing any secrets: ostensibly civilian space exploration serves that purpose rather well.
I've read a similar argument for spying - that countries begrudgingly want a certain amount of espionage to take place in peacetime. This is because it's better for everyone to know the extent of each other's military capabilities than to accidentally start an arms race out of a misplaced belief that their rivals are suddenly increasing development of weapons.
I was born in the post-USSR world, and am also British rather than American, so perhaps take my perception of the Cold War with a pinch of salt. :)
China putting a woman on the moon would be a little embarrassing to the US, but people would forget about it in a week or two. It wouldn't prove China's technological superiority, just some vague sense of moral superiority. And there are a lot cheaper ways to send that message.