Quite a few assumptions being made and quite a lot of hyperbole.
- The richest man in the world is not representative of the human race. Also, settling Mars (within timelines that musk is suggesting) is not treated seriously by any institution with significant power.
- We aren't putting earth's ability to host life in jeopardy. Not even close. Yes, human caused climate change is bad. Worst case outcomes lead to most human settlements going under water and extinctions in a manner that the planet has seen only a few times. But again, not even close where we need to abandon earth cuz we "ruined it" or whatever. Not even nuclear war would lead humanity to come to this conclusion.
As for why a civilization should be interested in spreading out as much as possible in case it wants to survive:
- spreading out reduces the probability of extinction. Right now, one gamma ray burst that's close enough, and that is aimed at earth can render the entirety of humanity extinct. But if we were more spread out, not all humans would have to die. The same logic can be applied to relativistic weapons aimed at earth.
- spreading out gives us access to a lot of resources. Earth's gravity and atmosphere makes it hard to manufacture and launch megastructures. Megastructures can allow us to create really cool stuff.
- many humans find exploring the universe really cool!
If alien species are anything like us, I highly doubt that they'd come to the conclusion that you've posited.