"If genetics determines behaviour, how might the ancient arrangement of nucleic acids so neatly line up with results in a field barely 50 years old – particularly since, early on when it was considered a menial task, programming was dominated by women?"

A fair question.

On the first part of the question:

Maybe hundreds of millions of years ago, the distant ancestors faced selection pressures where there was a survival benefit for males to be the risk takers, who roamed in the wilderness hunting, needing to learn the geometry of their surroundings to survive, the selection sword knocking off the guys who could not find their way home or who failed to keep track of where the dangerous predator or edible prey were located.

The result? Recent studies showing men do better than women in localizing sound sources (Zundorf, 2011) and showing brain activity in "temporal lobe regions was positively correlated with math reasoning score in men but not in women" (Haier & Benbow 1995).