But gender isn't a social construct - that's why this happened. Nobody constructed Leelah to be a girl, she was a girl on the inside; they tried to construct her to be a boy and it didn't work out. The fact that transgender people exist means that gender is innate. I don't know how, I don't know why, I'm not a biologist or a psychologist or any of those sorts of things, but I do know that it's not a matter of whether we "need" gender identities, it's a matter of what to do with them.
The reason Leelah killed herself wasn't because she was being "forced to change genders", it was because she was not allowed to change genders (or rather sexes - transgender people change the sex to match the gender, not the other way around).
Sex is what is biological, and what can only be changed by surgery and hormones. There's a reason that gender grew into what it now is out of its earlier role as a grammar term: gender is a linguistic construct that is built into all of the ways we view society. Gender governs everything from "the man is a Mr., but the woman can be a Ms. or Mrs. depending on her marital status" to "the generic singular pronoun with indeterminate gender is 'He'" to things that don't seem directly connected to grammar rules, how we talk and think about the differences between the sexes in general.
Put more simply, surgery and hormones can turn a man into a woman or vice versa, but it takes language to change a male into a female or vice versa, right down to changing the fundamental building blocks of language like pronouns.