The scenario that comes to mind is a massive asteroid impact, but your final sentence sums up the objection nicely: identifying and redirecting a space rock seems at least an order of magnitude less difficult & technologically distant than building a self-sustaining colony on Mars.
And yet, again, a Moon colony would be handy to counter an asteroid too. The far side could host very powerful telescopes that could map NEOs with unprecedented efficiency and clarity. On Earth, you have a couple hours of sensor exposure. On the Moon, you have two weeks to trace stuff. And most of the heavy parts could be manufactured in situ, be lighter and higher quality (made in a high grade vacuum).
And that's to say nothing about the ability to launch spacecraft from a lower gravity and/or using a magnetic rail. One could even turn the asteroid into dust (which is less dangerous than a ferrous mountain falling from the sky) with a kinetic impactor packing enough energy.