One root of the problem is that the X-Men books are firmly rooted in the superhero genre (no naughty word, I know...but bear with me), which means they are purposely tied up in a never-ending struggle, that there will always be battles with the world's survival in balance etc. and there is always a tendency for things to get worse instead of better and no happy end in sight. The blowback from this can come when the writers lose sight of the fact that this is by their own design.....and make howlers come out of the mouths of their characters.
Another problem is that Marvel's mutants not only have to contend with mutant-hating members of the general public, but also with mutant supremacists trying to take over the world etc. - indeed, in the X-Men they came first. Practically nobody had even heard of mutants, let alone seen reason to fear or hate them before Magneto and his Brotherhood of Evil Mutants (catchy name, that) started attacking military bases, taking over Latin American countries etc. It's very much a two-way street....and the Mutant supremacists, by virtue of being personally more powerful and usually much more competent, do a lot more damage than the Anti-Mutant factions.
Hell, the two major "bottleneck" events in the Mutant population (Destruction of Genosha and the Decimation) were caused by......other Mutants (Cassandra Nova and Wanda Maximoff, respectively).
Then there are the methods used by the good guys, which are firmly rooted in the traditions of comics, pulps and kids' adventure stories, but which are somewhat removed from the way discriminated groups act to overcome prejudices and discrimination in the real world. So for decades the X-Men never even tried to help bring a grass-roots movement in support of mutant rights off the ground or to network with politicians or journalists sympathetic to their cause, instead they preferred methods of subversion (concealing the fact that they were mutants from the public), disinformation (e. g. by mindwiping people, or the computer virus used to erase X-Men-related data in the Pentagon's computer system) and black-flag operations (the setup of X-Factor, Inc., and the X-Terminators, both facades used in early X-Factor).
From a public-relations and civil rights movement POV, the X-Men throughout the bulk of their existence were simply a rolling catastrophe - they arrive at a place, fight a huge battle with a lot of collateral damage (as the old joke went: You can always tell where the X-Men have been) and then disappear, leaving the bystanders to piece together what happened and whether the X-Men were good guys or bad guys.
If the Southern Christian Leadership Conference had instead named themselves "Negro Ninja Force" and spent the 50's and 60's mixing it up with the Black Panthers and the KKK in street riots and mass arson.....the Civil Rights Movement might have had a much slower and rockier road.
The X-Men also have a disturbing tendency to isolate themselves. Some fans take exception to the cult comparison, but the way the X-Men operated at least until the 1990s can be seen as quite disturbing: Mutants are recruited at a very young and impressionable age and taken from their familiar and familial environment (and it really is noticeable how few X-Men of that generation stayed in touch with their families and childhood friends). This often involved deceit (making the young mutant's parents believe their child was attending a normal, if elite school), or outright brainwashing (e. g. mind-wiping the Beast's parents) and coercion (Phoenix using mind-control on Carmen Pryde so that he would allow Kitty to go to Xavier's School - with Scott's and Ororo's acquiescence). Not to mention ulterior motives - they were (often) chosen less with an eye toward helping them handle their powers and learn skills they did not even know they wanted, but to become child soldiers in a mutant militia (ex: how Charles Xavier travelled all the way to Chicago to recruit Kitty, but did not invite Doug Ramsey to his school, even though he lived in Salem Center).
These methods are comparable to those of certain cults, but also to the way e. g. Aborigine children were taken away from their parents to be raised by white Australian foster parents or the way the US Government confiscated American Indian children to be raised in orphanages. Someone else decides that they can raise your children better than you. The X-Men don't even do it under color of law (with at least the fig leaf of accountability).
Note also that quite a few of the young recruits did not need to be saved from howling mobs (and that strangely enough non-mutant superpowered people apparently have a less urgent need of being trained in the use of their powers). Ultimate X-Men (early on, before the Ultimate Universe went nuts) played this a bit better.
Sometimes one also has to wonder if the mutant metaphor is taken so far that it wants to show the readers that just because someone belongs to a discriminated or even persecuted minority it doesn't mean you're nice...or simply doesn't matter if you're not nice (persecution justifying evil acts). Eventually, the X-Men stories began to drop the "coexistence" theme, and became more about leveraging their powers in a paramilitary fashion for "mutant survival" (which, as we'll see, was not only limited to "not being killed or locked up").
M-Day occurs, depowering all but ~200 (deviating as the plot required) Mutants. The X-Books then become a virtual non-stop quest to undo "No More Mutants"...and make damn sure that future teenagers will randomly get superpowers, or blow up, or become hideously (often uselessly) deformed, or turn into clouds of gas and die when their containment suit is punctured (etc, etc). It should be noted that many mutants were very happy that they were no longer "special" (either because they were less likely to be hunted down and killed, die in an X-Men battle, or were no longer hideous/bubble boy)...to which Cyclops replied with a raised middle finger.
This reached its apex in the AvX crossover event, when the X-Men (Cyclops faction) were so bummed out by not being able to have babies that weren't baselines (ironic commentary on accepting the differences of your children, given the X-Men comics' running theme), that they decided to roll the dice with the Pheonix Force....an entity well known for its manageable and predictable nature and never destroying entire planets.
Then they took over the world, and began to make it a better place for Mutants (Cyclops' words)....using force where 30 seconds of platitudes did not convince. With the enthusiastic assistance of 90% of the X-Men. Exactly like the Anti-Mutant zealots had always predicted.
Even the "good mutants" have no problems with the name homo sapiens superior, which really is a PR nightmare, and many of them to a greater or lesser extent believe that it is the mutants' ultimate destiny to completely replace non-mutants on Earth (in effect: "we will bury you"). In the early 2000's, this aspect was taken to ludicrous heights of internal self-congratulatory overtones, as the X-Men discovered that a "gene" in the baseline homo sapiens genome was going to render baselines extinct within 50 years (evolution doesn't work that way)....and then actively work to keep this under wraps (as they were worried that the baselines would fight to avoid extinction....ironic considering Cyclops' actions in AvX).
Then there is the thing that even the "good" (X-Men and their allies) mutants really, really seem to be insular. This, among other things, led to a situation where non-mutant superhero teams have been welcoming* to mutants since mutants became known as a group (with the second Avengers lineup consisting of two mutants and two non-mutants, and e. g. the Champions containing two former X-Men and the Defenders at one point three) while the X-teams stay closed to non-mutants (with the odd exception in the form of aliens). X-Factor for a time had a base (Ship) that could not be entered by non-mutants, and apparently Scott Summers' (at the very least) definition of Utopia is "a nation without non-mutants (except for one or two trusted flatscans)".
The X-Men got to attend social functions the Storm/Richards and the Van Dyne/Pym weddings, but did not reciprocate by inviting the Fantastic Four or the Avengers to theirs. Nor did they use the connections built up by Iceman, Beast, or Angel to try and get more mutants on the Avengers roster.
So it's pretty apparent that the X-Men are hardly blameless for the deterioration of their relationship to the other superheroes, or for the Avengers or FF not being very responsive to Mutant-only problems (a charge leveled by Cyclops against Captain America). If you go to great lengths to conceal your wife having Cancer....don't blame your distant cousins for not sending flowers.
Also rather glaring is that most attempts to start a mutant society or nation tended to be at least a little (or a lot) exclusionary. I mentioned Utopia, before that there was Genosha, and the Morlocks, neither of which came over as a place where a non-mutant would be welcome. If you are trying to avoid be excluded and marginalized (or simply separated out and eliminated)....not being exclusionary yourself is a good start. Most successful minority integration stories start with them moving out of the ghettoes, or bringing outsiders into their enclaves to mix.
*-admittedly, this probably has more to do with the X-Men being a smaller share of the Marvel books, back in the 70's and 80's, so the X-writers couldn't dictate policy for the MU at large. Therefore, the Avengers/Defenders writers never made much of an issue about their Mutants.
TLDR version: While Mutants are a minority, and one which is actively persecuted.....the Marvel writers and creative teams are seldom up to the challenge of presenting that in a thoughtful manner. The X-Men, as an advocacy/promotion group (their original and, for the majority of their existence, prime purpose), fail epically.
Mutants are inarguably subject to outright racism and discrimination (as we've discussed, the Human Torch is a celebrity, and Pixie is hunted through the streets...even though both owe their powers to modified biology).....but many of the specific problems that the X-Men themselves rail against are largely products of their own behavior and tactics.