To me the whole “Earth backup” aspect of humans on Mars is secondary at best.
The bigger benefit is how it gets the ball rolling on development of all the technologies associated with keeping humans alive and thriving in space and on the surfaces of other bodies in a way that the moon can’t.
The problem with the moon is that its distance. It’s convenient, which means that doing anything there isn’t much of a commitment and thus, can be canceled and forgotten about on a whim. It also means that there’s not much pressure to make human presences there self-sustaining — worst case scenario, another rocket full of supplies and/or personnel is only a week away.
A presence on Mars on the other hand by nature has to be something less frivolous. You have to plan to be there a long time no matter what, and from the moment the first crew’s boots touch the ground they’re going to be pouring themselves into becoming self-sustainable. The nations and companies behind the project can’t so conveniently pull the plug. Once it’s there, everybody involved is in it for the long haul and the longer it exists and more it grows the harder it is to back out of.
So I guess more than anything, out of the destinations that are being seriously considered by NASA, SpaceX, etc, Mars is the best at providing some kind of insurance against stagnancy and malaise in the crewed space program like we saw from the late 70s through 2010 or so.