This is a question that gets explored in x-men continuity alot. The basic answer is that they are trying to get the world around them to accept them and by saving people and being heros they bring positive representation over potential fear.
Their also role models for other mutants who are scared and alone. They try to be someone other mutants can be inpired by.
And in alot of x-men stories their not heros like the avengers or spiderman, with the everyday heroics for the average man they deal with issues mutant related. The rouge mutant, trafficking, people coming to kill them, theyll jusg protect anyone in the area of the battle.
You also see them in the phoneix arc and with croitia move away from humanity more as they engage in an self isolation policy to protect themselves.
While not neccasarly intended by og writers theirs a reason why charles is equalld to Martin Luther King Jr, and magneto to Malcolm X.
King championed nonviolent integration, while Malcolm X initially promoted Black nationalism and self-defense "by any means necessary". Despite their different approaches, both aimed for Black liberation and converged towards more similar goals near the end of their lives.
Understanding history if you dont want to read the comics, will inform you alot if the x-men as they were written during very pivotal momments of american history,. With ww2, the holocaust, black civil rights, woman rights, lgbtq rights, aids crisis, coldwar, vietnam war Ext.. happening one after another 1960s-1990s was filled with political activisim from repressed voices and goverment supression.