That's a serious paradigm shift compared to what this (excellent) article describes.
This is a big part of their obsession with lowering costs to space. When the launch costs are not such a huge economic factor, you have much greater leverage with doing things like building, resupplying, or even engaging in interplanetary commerce.
Going to Mars may have been part of the story, but I doubt that it was a strong component of the decision making in the end.
So the most logical place to start for this sort of 'humanity guarantee' would be Mars, which shares an oddly large amount in common with Earth. There's a verbose (and rather entertaining read) with lots of first party commentary here. [1]
[1] - https://waitbutwhy.com/2015/05/elon-musk-introduction.html
This article is however very useful to bring pragmatism to the discussion.
Maybe the best insurance for humankind is to start shipping a continuous stream of robots to Mars to prepare human landing in many (many) years.