Sex is a matter of biology, while gender is a matter of grammar, and there is no earthly reason why sex should be involved in gender distinctions.