The Earth is only a moderately successful habitat. It is vulnerable to all manner of catastrophies and has had its delicate workings thrown out of balance repeatedly throughout history. If humanity is to thrive in the very long term it will be necessary to create new environments apart from the Earth. This will minimize the risk of humanity as a whole being completely wiped out by a celestial or human engineered catastrophe and allow humanity to make use of the almost unlimited room for expansion available in space as a whole rather than being constrained by the relatively small amount of usable space on the Earth.
Some good short term possibilities are moon colonization and colonization of the asteroids. Metallic asteroids in particular could be blown up into large rotating globes which could be made into Earthlike environments. Whatever the mechanism, there is a clear need to expand beyond the limits of terrestrial habitation.