The energy that our universe is made of is best viewed as a spectrum.
Humans took the spectrum of visible light, infinite colors and reduced it down to 7 (ROYGBIV)
We did the same with the gender spectrum.
In the west, we reduced it to 2, many other cultures have more gender categories, though in reality there are an infinite number of gender expressions and identities.
So one could argue that a person who is "transgender" is simply an individual who does not fit societies gender binary. Because current society enforces a gender binary, that doesn't mean transgender people are ill, it means that society does not currently understand, or have a way to talk about gender as it truly exists.
Society does the same with race. Black or white? I'm "white," yet every summer I end up having a "black" person put their arm by mine to compare skin tone. We are usually equal, and at times I've been darker than a "black" person. In reality, our skins have a different way of working with melanin, we aren't really black or white.
So... while there are binary chromosomes XX vs XY, gender is different than that. And to be fair, the universe doesn't always stick to the XX vs XY thing.
Human words and ideas of gender do not accurately capture the reality of it. We don't need a reason for being the way we are, besides the fact that this is how we are. Own it!