That's not exactly what the research shows. The great book "Unlocking the Clubhouse" shows off some research to suggest that culture within CS departments and software development companies are largely, but not entirely, to blame.
It's not like you get accepted to a school and forced to study philosophy. These student have a choice and for some reason they're not picking the ones that make good money