To expand on that, sex is biological, gender is grammatical. A man has a sex, he's male. The word man has a gender, it's masculine. The sex vs. gender and male/female vs. masculine/feminine distinctions are important. Male and female are sexes, they are biological. Masculine and feminine are genders, they are grammatical. The APA has long since abandoned sound science in favor of political correctness and blurs these distinctions. These distinctions are more prominent in romance languages where literally every noun has a gender. For example, in Portuguese, pens are feminine and pencils are masculine.