It's always been a part of the purchasing process for as long as I can recall. Name, birthdate, and gender were the 3 things they'd ask for to book a flight. Basically just to make sure that you are the one who bought the ticket, or it was purchased for. In person, I guess they'd always been "assuming one's gender" when we weren't buying online.
The other reason for knowing the person’s sex is that if there is a crash, they can better identify the bodies. “X” means the recovery team won’t know what they are looking for.