In the '60s the common way programmers were interviewed were through aptitude tests. The standard at the time was the IBM Programmer Aptitude Test, but in the 70s and 80s that shifted to a new personality profile that inherently favored men [1] [2] [3] by Cannon and Perry. This became the new institutional standard and was used to determine who was a 'viable' programmer or not. This is where the traditional 'programmers are anti-social and hate people' thing came from and took root. In turn, advertising became male-focused, men were given more opportunity to become programmers and that's how the industry shifted. There's a bunch of very blatant advertising in the late-70s and early-80s that shows how this shifted.
[1] https://www.businessinsider.com/sc/how-bias-pushed-the-compu...
[2] https://www.thoughtworks.com/insights/blog/born-it-how-image...
[3] https://www.history.com/news/coding-used-to-be-a-womans-job-...