Discrimination is never ok. If a woman applies to a job as a developer, she should absolutely not be discriminated against because of her gender.
Self-selection is always ok. If women in aggregate are more interested in biology than computer science, that is fine.
This paper is evidence of discrimination, not self-selection.