Here are some quotes:
First, from X-men screenwriter Dan Harris, a gay guy who co-wrote X-2 with a gay guy named Michael Dougherty.
"…. it’s become more a metaphor for sexual identity and orientation because it’s more appropriate to look at a person and have to say, ‘Are you a mutant?’…. you can’t always look at a person and know that they’re a mutant just like you can’t look at a person and know that they’re gay” (Filmfreakcentral.net critic Walter Chaw, X2).
Bryan Singer chose Ian Mckellen, a gay activist actor, to play Magneto in the film and convinced the actor the script was about gay rights.
Zack Stentz, a screenwriter employed by DreamWorks SKG wrote "I helped write the movie, and can tell you the gay rights... allegory stuff was all put in there on purpose."
Stentz also referred to "post holocaust Jewish identity" and civil rights but I do not recall the film at this point and have no idea what he's referring to because he only elaborated on the gay stuff.
He added, "Joss Whedon designed the whole "Cure" storyline in the comic books specifically as a gay allegory, and Bryan Singer wove his own feelings of outsiderdom as a gay man into the movie series."
Bryan Singer, the accused child rapist and director of X-2 admitted openly in an interview to BBC that X-2 has a "coming out scene" when one of the mutants is confronted by his uncomfortable parents regarding his mutation.