For me it depends on the game.
For example, in games where you create an avatar, I tend to choose male characters. This is because I'm not a female, and I could relate more to the male in the role. If the game offers any sort of choice and agency for the player, I choose male, at least initially.
In Mass Effect, my Male Shepard was a paragon, which is in line with my personality. When I played as a female, I went renegade, because I didn't feel like that character represented me in the same kind of way.
If however, I'm given the option to play as a male or a female, I'll usually choose females. Partially this is due to aesthetics, as I enjoy looking at male shaped pixels than females. Moreover though, I just like females better in general, and I see the character more as someone I'm spending time with than someone who represents me. I tend to be more interested in females, their personalities, and their histories. So, if I was given the choice between getting to know a guy or a girl, I'd rather get to know the girl, even if it's a virtual one.