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.
What significant difference does it make if we put a woman (or woman of color) on the moon first vs putting another white man on the moon. [with modern technology].
I could think of a few positive reasons to do this, but it shouldn't be the main driving force of competition.
Sending a woman (or a person of color for that matter) to the moon has no scientific benefits unless the mission is framed as building a long-term colony there (where both men and women could participate) for example.
You enumerated several political reasons but no scientific ones as I understand. Hence my question.