Mars has vast mineral resources. That's the reason the surface of Mars is red, iron oxide - rust! So the point of a colony is to enable infrastructure to, over time, develop on Mars. For instance another big winner is the Sabatier reaction. CO2 + H2 => methane + water. Starship fuel is, uncoincidentally, methane.
Getting people on Mars will be inspiring and humanity's greatest achievement to date. That it also serves as a 'backup' for humanity, is something that provides a motivation get it done ASAP in times like those that we live in, but is in many ways also largely incidental.
• Colder than Antartica
• Drier than Sahara
• Lower air pressure than top of Mount Everest
• Soil perchlorate concentrations on par with a Superfund cleanup site
• Atmosphere contains negligible oxygen, nitrogen; you need the former, plants need the latter, you need the plants
• No ozone layer (not that you're ever going to be outside, what with the air being unbreathable in two distinct ways)
• No magnetosphere (so CMEs are dangerous rather than being pretty light shows)
• We don't even know yet if the lower gravity is important
I say this as one of the people who finds Mars inspiring, and would even consider being a Martian colonist: The technical capacity to make Earth as uninhabitable as Mars already is, would also threaten Mars.
Nukes? Mars colonies are much more vulnerable. Engineered viruses? If they existed, private companies could already ship them to Mars — etc.
If your goal is a backup for repopulating after a disaster, we can already do hermetically sealed metal boxes isolated from the outside world for long durations at a time, where at least one such box of people is always secreted away in an unknown location at any given moment: nuclear submarines.
I know these things about Mars and am still unconvinced. A fully independent manufacturing pipeline is completely nuts especially at the quality and quantity levels that we are used to. Many materials are not viable except as biproducts of other processes subsidized by the scale of Earth manufacturing. There is no magic wand that we can wave so that if we want it enough we can have it. If humans are indeed capable of such feats then they are capable of the much easier feat of Earth or Moon colonies. Might as well develop an independent manufacturing pipeline on Earth just practice because you wouldn't want to find out the hard way that a critical step doesn't work and it was all for naught. And if the alternative is to stockpile large quantities of chips or rare earth materials then how long are they expected to last, 100s of years?
Ah! The idea is not for people to just go live on Mars as a replacement to Earth. I agree that is unrealistic on anything even remotely reasonable as a timeframe. Rather it's the opposite! Like you mentioned, even in scenarios that kill effectively 100% of people on Earth, it would still be a far more hospitable place than Mars, with very few exceptions.
So the idea of a backup is not that we just go live on Mars, but rather that we have a significant number of people on Mars (and elsewhere ideally) that can return to Earth in such a scenario, help restore order, find/rescue survivors, and generally get society going again. It's simply the planetary equivalent of being able to send in aid to an area after a catastrophic force majeure.
Getting people on Mars will be inspiring and humanity's greatest achievement to date. That it also serves as a 'backup' for humanity, is something that provides a motivation get it done ASAP in times like those that we live in, but is in many ways also largely incidental.