HOWEVER, you are also born with a gender identity that either aligns with your sex or not - this is also not of your choosing. This means child may be born male, but as their gender identity starts to materialize they can find they do not identify as what they were born.
No one is born with a gender identity; no one is born with an identity at all. Identity is something constituted, not constitutive, because identity specifically is something that evolves out of the way we represent ourselves and the world around us. At birth, no one has any representational faculties.
That said, there's nothing deterministic about behavior; that is, being raised a certain way doesn't mean you will definitely be homosexual. Sexuality is fluid, and can change at whim, which is why it's impossible to trace it back to an original identity. Sexuality is entirely contingent, and no sexual preference or libidinal investment is more objectively valuable or "better" than any other.
I think Pat would call gender an "emergent phenomena". I also think it's on the level of importance as pet rocks. We primarily identify our "gender" through levels of consumerism.
I wouldn't call it "a phenomena" since that word is plural.
Furthermore, it all has to do with whether you buy into emergence; as of right now, I find it to be a persuasive explanation. However, it really only provides an epistemological explanation (how?), not on ontological one (why?). It remains to be shown whether emergence is merely a way in which complex systems appear to us, or whether it actually affects the supra-sensory world (i.e. noumenal reality).
Aside from that, emergence is nuanced. Sexuality might be an emergent phenomenon, but that doesn't mean it's not real. All it means is that it can't be traced to an original essence, which is my point above. So, in that regard, you might call it emergent.
I'm going to end my rant there and look more at the pretty pictures.