People aren't rational. The top two explanations would probably be: society says women shouldn't be doing those jobs; the person hiring believes women shouldn't be doing those jobs or would rather have men around.
If we made every decision based off of sound economic or similar principles there's a lot that wouldn't happen. Gas guzzlers wouldn't be so popular (from a global or national perspective gas sippers make far more sense for pollution, personal finances, overall security because of reduced dependency on others). But they are.