I'm not sure sports are more of a time sink than a lot of kids would otherwise spend doing something mindless like watching TV or gaming. It's a couple of hours a day after school for practice and half a day on the weekend for a game (yes I have three kids in sports).
There are kids (and parents) who get totally invested in a sport with often unrealistic expectations of college scholarships or professional careers, but there are a lot who are also remain very academically focused and balanced. I know that many of the kids on my oldest son's high school teams went on to college in STEM fields so it's not an either/or.
According to the anecdote, "Her friends thought that any intellectual interest was nerdy and stupid, and my sister acted accordingly" had an impact, not that it took time to hang out with them.
Huh? I lettered in three sports, plus played in multiple musical groups and was on the quiz bowl team, and still found plenty of time to learn to program in assembly language and Forth.
(Though it is true I did very little partying.)
Unlike "hanging out with friends", a universal activity, extracurricular sports actually do conflict with early computer science exploration (they're a huge time sink, as any parent of a kid in a sport will attest).
Meanwhile, sports draws in more boys than girls.
Why are we so quick to accept the notion that after-school activities that girls participate in isolate them from STEM, but after-school activities dominated by boys don't?
As a nerdy teenager, I never had a problem with any girl in any clique or social group at my school. But I sure as shit had problems with the boys in sports.