Well, yes, family expectations play a role with computer programming. In the 70s and 80s, computer programming was largely a hobby for boys (and men). My grandfather (electrical engineer) had a computer in the 70s, but only allowed my uncle and male cousins to use it and learn DOS or whatever. The girls in the family weren't allowed. Period. That attitude is still, unfortunately, around today.

There's also the issue that you're interacting with a computer rather than people - which isn't enticing for girls. Notice that women usually interact differently with digital technology than men. This escapes many hardcore CS types (often on the spectrum). It's a social/ communication barrier.

Another issue is that many women (not all) fundamentally do not think in terms of computer programming. I was reminded of this in the winter when I was talking to another homeschooling mother who thinks in code! She literally thinks in terms of IF and Then and can easily visualize code. I'm the opposite. I think in terms of plotting or connecting scattered dots. It's just different.

Also, STEM degrees tend to favor workaholics and those who don't have or want a social life. Academia does as well. This causes a problem for girls because most want to have children and this thought does tend to crop up around puberty. Hard to ignore. So there's the potential of huge sacrifices for girls who go down the workaholic STEM route. And not to mention the part about the nerds and dorks in STEM who may not be viewed seriously as marital material.