Even after the worst imaginable asteroid impact, Earth would still be much more habitable than Mars. Keeping a "backup" on Earth would be far easier than keeping a backup on Mars. At the end of the day, Earth has a thick atmosphere, abundant water, 1g of gravity and topsoil, and Mars lacks all those things.