The best habitats and the habitats supporting many Earth populations will be the asteroids with terraformed interior spaces. Planets and their expensive gravity wells will prove to be dangerous habitats risking extinction of its population in the same manner as the Earth.
I actually wrote part of a story where people went out to the “asteroid belt” and basically slagged the inside of an asteroid to hollow it out and build their habitat inside