Originally gender had nothing to do with sex. How they came to be equated is beyond me. In some languages today they have no relation whatsoever. Trying to equate gender with sex would be as ludicrous as trying to relate color to shape. All balls must be red just because pomegranates are? Leaves are green so all flat objects must be? What planet are you from?

Besides, in modern English babies are neuter. "Oooh, it's sooo cute! Is it a boy or a girl?"