Law and medicine are more people-oriented, while tech is more things-oriented, so that could account for the differences between the industries. There have been studies on the gender differences in interests along the Things-versus-People dimension [0], including one that linked them to prenatal androgen. [1]
[0] http://onlinelibrary.wiley.com/doi/10.1111/j.1751-9004.2010....
[1] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3166361/