what is more interesting to discuss is why the same fervour is not given to other jobs where an imbalance in gender exists (for example, registered nurses).
There's also more male electricians than female ones.
I feel that if females who would have made good engineers are turned away by discrimination or harassment, there's a good opportunity for a company to find hidden gems of an employee for lower cost than the equivalent male by making sure she is treated well. Then natural competition should balance out the cost difference over time.