The thing is being a girl or a guy does affect who you are. It's the world we live in. If the story is set in some utopia where gender doesn't matter then it's different
I agree, but I would also point out that oftentimes a character's maleness, whiteness, etc. often times doesn't really play a part in their story in a meaningful way. While gender does in fact matter, there's varying degrees of "mattering" you can have it be in the context of the story. Not all stories call for gender mattering, even if in the society gender matters to some degree. There should be freedom in that regard. Basically, whatever is good writing for that situation is good. Sometimes focus on identity is great. Other times, it doesn't matter so much. It's OK to have characters that happen to be X or Y. So while it's an important topic that should be discussed in writing, it doesn't need to be the centerpiece of every story.
Of course, if the society in your story is really homophobic and lynches gay people, it would be weird if a gay character's homosexuality didn't play a key role in the story. I would think that the writer planned the story very poorly. If it took place on a liberal arts college campus, then it's not as necessary, but there should still be something there considering identity politics going on in America right now.
I find that a few people complain when a character is non-white, non-male and those aspects don't play an important role, but those same people don't complain when a character's whiteness etc. doesn't play a role. That is, for some people there's an underlying assumption that being white or male etc. is "normal", and deviating from the norm requires a good explanation and extra effort. For them, if you want to make a female character you need to have a reason for that character being female. For example, when that new Civilization game in space was announced and the leaders for the countries were shown off, one or two people on the subreddit were vocally complaining how so few of the characters were white males and that creating a diverse cast was just pandering and shoving minorities into the player's faces. (Luckily they got downvoted to hell).