Social stigma plays a large role at that age; this is also when they start thinking about boys and having self expression (clothes, music, books). It's _nerdy_ to be interested in computers. The know-it-all also becomes the outcast. That's the geek or loser. There's nothing more important than social status. It's really unfortunate.
Why do you think social stigma only apply to girls?
This was before knowledge of comp sci salaries have gone mainstream (before 2012), although it's still a relevant, anecdotal reflection on the backgrounds of current software engineers.
My AP comp sci class was actually composed of non-high achieving people. AP comp sci was the only AP class many of the students took. The high achieving students didn't take AP comp sci for whatever reason.
I think AP comp sci was actually considered lower status/prestige compared to the sciences Physics/Chem/Bio among the high achieving students.
Maybe they didn't like to take classes filled with spiteful boys with chips on their shoulders? The 'whatever reason' is the important part.
The students. AP comp sci at my high school was an elective that people took. The people who didn't take it chose whatever elective they were interested in (water basket weaving, guitar, etc.).
And what motivated the people to choose AP comp sci? This is just an anecdote but almost everyone in my AP comp sci class was into gaming/nerdy hobbies/internet forums/etc.