When writing a science fiction one thing that has to be addressed is why are people in space? Getting to space is very costly after all.
While I would love to think that we could and will have a large moonbase for purely scientific reasons I doubt that will happen. Given the costs involved too many people would object.
If you want it to make sense for us to be in space and stay there you need to come with a good set of reasons.
The first, and honestly best, would be economic. For example in my book the reasons humans got into space to start with was that the crystals for optical computers could only be grown in zero gravity.
Now the problem with making things in orbit is that it costs a lot, mostly because everything has to be shipped up earth’s gravity well. You also are limited by the bottleneck of earth’s launch capabilities, it could take decades to increase them by a real amount.
That is why past a certain point it would make sense to either set up a moon base or drag an asteroid to high earth orbit.
This brings up the second economic reason to got to space, raw materials. If your in orbit of earth or on the moon it’s cheap to shoot ore down to earth.
You would reach a tipping point however, once you have an easy way to orbit (space elevator, orbital ring, rail gun launcher plus skyhook. Lots of options) and can do manufacturing in space the cost would be cut to almost nothing. At this point the only thing you might bring to space is people.
The second set of reasons would be military. A fact that few people really acknowledge is that if one nation controlled space they could not be fought. If you had a thriving space industry and your enemy did not they would not be able to win any kind of war. You could hit their cities with cheap bombs that would wipe the city out. You would see anything they do coming and they would have to rely on planes for surveillance.
One idea that pops up here and there is that the earth is dying and we need a colony on Mars (or sometimes the moon) to survive. So we put all the effort we can into creating the base to save the human race.
While I have read some good fiction with this idea I think the amount of effort needed to get to Mars is underestimated and the effort needed to survive on earth is overestimated. Setting up a colony on Mars that would be able to survive cut off from the earth forever would require a very large amount of resources. You would not only need to have the base in a location with raw materials, you would need the machinery and expertise to create everything from microchips to rockets. Unless we are talking about thousands of people there would be some specialties that you just could not have.
Think about how big the ISS is, now think about how much material you would need to send to mars. You could burn through a decade of launches just sending 100 people and machinery to mars.
The other side of the coin is how much the earth would have to change for such an effort to be needful. Even if our atmosphere become unbreathable and all the plants and animals died it still would be much easier to live on earth. Whatever happened to the earth it would have to be something that would not even let humans live in reinforced domes using greenhouses to grow food.