Even if a huge asteroid hit, we could almost certainly build shelters where more people could survive the initial impact than we can settle on Mars in the foreseeable future.
An analogy: a bunch of important files become corrupt (cataclysmic event) and the domain expert is no longer with the company (loss of knowledge and industry). It is much easier to move forward if one has a way of contacting a subject matter expert (Mars colony) to restore or rebuild what has been lost.
I believe we also need a colony to hold on to seeds of civilization in the very sense of the word.
It's like making a backup of your computer but never testing restore. The chances of that backup not being complete or recoverable are fairly high.
The backup of human civilization on Mars will probably be theoretically worse than one that can be made on Earth. But it will be supporting life, making it fully tested and thus practically better.
It hardly matters that the apocalyptic Earth is more hospitable to human life than Mars currently is if we don't have any humans left to resettle Earth.