I think you're looking at this through too narrow a use case. I agree you shouldn't be taking individual people and guessing what their genders are. And you should minimize the instances where gender is even relevant in your application.
But what if you have a whole bunch of data and want to do some aggregate statistics? "Do women use our product?" is a perfectly reasonable question to ask yourself. You don't need it to be exact, and it's certainly not reasonable to ask every user. So you use some heuristics and you get some useful data.