I've always been confused by this question. They always talk about peace and how the world fears and hates them, but if you look at any comic it's probably because they always leave a high body count. Why do they always call people like wolverine if his powers are guaranteed to kill people? The worst part is they hardly talk about it or feel bad about murdering 100 people just to rescue one person! Can someone please explain their morality code to me?
The change of heart came about with M-Day, with only approximately 200 mutants left, Scott (in particular) turned more towards the Magneto way of doing things by putting mutants and their safety above the Xavier morals. So if you were considered enough of a threat, you could expect a visit from the X-Force.
Well the Xmen aren't usually the ones that leave the high body count, it's their evil mutant counterparts (most of the time). However, most of the Xmen don't have a strict code against killing, unlike spiderman. Honestly, in their comics they talk about being "hated for being different" a lot. People try to compare Xmen comics to events like the civil rights movement. I'm not a fan of this, because most minorities can't blast holes through mountains with laser eyes.