One way to look at the dream of escaping the planet and colonizing space is in mythological terms. One comparison in particular is good and this is the idea of the afterlife or heaven which for centuries were as real and attainable as a Mars colony to you and I.
For advanced technocultural civilizations and the religious institutions that hold them together it seems that an imaginary place of escape automatically becomes normalized into existence.
The illusion grows proportionally to the sense of futility that individuals feel as a social structure calcifies around the protection of class hierarchy. The consequent protective buffer against meaningful experience of complex ecology and culture that results is the proverbial bottle which constrains the human spirit, until it is ready to explode in unrealistic directions.
So the suffering and anxiety of individuals trapped in a top-heavy social structure lends energy and reality to unrealistic visions.
Thus we dream of terraforming mars while in the midst of terrastroying earth into an unlivable nightmare, mass extinction, unbalanced population growth, global chemistry change, etc.
Like, we can't even prevent our rainforests from being raised, losing countless complex organic systems forever, yet we imagine ourselves spawning new life on distant planets.
And the destruction of our own planet is made possible with only the tiny drops of energy we can dig out of the ground. What will become of our planet surface when we have tapped the energy of the sun in earnest?
That said, if we do survive the current paradigm, and do manage to protect our surface biofilm or otherwise survive the next few hundred years, nothing will prevent us from colonizing the solar system and beyond. But we are ahead of ourselves, and that's the result of poor social/cultural order.
There's some irony there. The engine of malcontent that destroys us also propels is forward.
However it's safe to say that most of the energy and excitement we feel for terraforming planets and exploring space right now ought to be redirected towards building a conservationist earth culture that can support slow technological accretion and a long-term template for extra planetary adventures. Heaven is real but it takes real work to get there.