Shutting down a lit city could be tricky. People tend to disagree with that markedly. This sort of thing was done all the time during WWII, but that was because there were men with thousands of pounds of bombs looking for lights in the night.
However, trying to simply develop a city without lights is easier. Religion could easily latch onto the stars, making any non-red lights forbidden for fear of accidentally extinguishing them. In a scientific situation, you might be able to claim a local observatory was so important that it could demand complete darkness. Kit Peak observatory, near Tucson AZ, didn't turn the lights out over the city, but they did at least get them to switch over to using one particular style of street lamp with clear spectral lines that could be filtered out. If you had an even more sensitive scope, that might be enough to ban light all together.
EDIT:
If the reason needs to be dangerous feeling, just introduce some danger that the observatory is vital to counteract. The system has numerous extinction-event-threatening asteroids or comets in play. You have the tech to readily swat them before they hit, if you can detect them in time. However, until you complete the infrastructure to be able to build another, then complete the additional scope itself, the only telescope you have that can do a good enough job of tracking them to get the job done, is one that came with the impactor, and is unable to be moved from the site. Likewise, can't move the city, it's also dependent on the wreck.