No, if an object as large as the moon hit the earth - the earth might even be destroyed (but probably not). To wipe out humanity a body of the size between 10-100 miles in diameter would probably suffice. Fortunately near-earth orbits with a body of that size is rare.
I'd imagine polluted water and air with still some flora and fauna would still be better than none of those things.
Start by building a self-sustaining base in the middle of the desert. If you manage to do that you'll be improving the life on Earth for a lot of human being. When all deserts, including Antartica are terraformed, colonized, and we run out of space on Earth, then maybe we can feel the need to colonize mars.
Before than, it's just dreaming about living in a sci-fi movie.
No one has said there aren't other things worth working on. And maybe they are more important short-term (even Musk has admitted this much). So: by all means, go forth and work on them!
The asteroid was the root cause of the Cretaceous–Paleogene extinction event. The direct cause was ecological collapse.
To oversimplify things a bit, the impact event kicked up enough pollution to undercut the food chain by starving out anything that relied on photosynthesis, which starved out the herbivores, which starved out the carnivores and omnivores.
Typical asteroids are not large enough to wipe out all human life in one go. A large impact could kill billions between direct fatalities and follow-on deaths via starvation and plagues, but your survivor population would still easily exceed anything we can sustainably place on Mars (or any other extraterrestrial location) within the next few hundred years.
Even if it completely refactored modern civilization, you'd probably see some population capable of organizing and recovering a sustainable society. And that is with mass starvation, with plagues due to loss of sanitation infrastructure, with conventional farming being disrupted for years, and with the assumption that some idiot decides it's time for a preemptive nuclear war.
Furthermore, any sustainable Martian colony you could produce could equally well be isolated in a hardened bunker on Earth, if surviving a large asteroid impact were the only concern.
To wipe out all humanity with one impact, you would need to hit the Earth with something in a slightly larger class - say, the Moon.