"Gender is a grammatical distinction and applies to words only. Sex is natural distinction and applies to living objects." (See R. Morris in Webster 1913 / Gram. section.)
This is one of the pet peeves of G. Gordon Liddy. It is his contention, and probably the contention of others who were educated by the Jesuits, that one should not use "gender" except in reference to grammar. When discussing males and females, one should always use "sex."