They have anti-gravity, force fields, automation, and all kinds of crazy stuff. I'm sure that you could manage to do it.
/STG/ - Star Trek General
And yet when they found the sphere in Relics they freaked out about it. Engineering of that scale was beyond Starfleet's technological capabilities.
Given that the largest structure we see Starfleet build is a Starbase, and that the response to finding a functioning Dyson Sphere in TNG was "oh holy fuck, they're actually possible" I doubt they have anywhere near the industrial capacity to make it work. They have a lot of the tech down, but no way to reliably upscale it to the absurdly large scale needed for a ringworld.
Just because you have that tech doesn't mean building a massive fuckoff space station is worth the time and effort. Again, planets already exist without needing to build them, and they have a bunch of resources anyway. Even uninhabitable planets can be made habitable with terraforming as long as they're in the habitable zone, for less resources than it would take to build a space station of equal living space. The largest space station we know of that was built by the Federation or its surrounding neighbors, Earth Spacedock, only has living space for tens of thousands of people, nowhere close to the billions that can live planetside (trillions if they stopped caring about comfort and sustainability). Anything larger than that has been consistently presented as being far beyond the tech level of the Federation.
What about something more closer to a planet or a moon, like the Halo Rings from Halo? You could make many rings from the resources of a single planet. Each one would be more efficient use of space than just colonizing the crust.
No you dipshit. The planet is already there. It's already in existence. The most you need to do is bring in resources for the initial colony and then use whatever's on the planet to expand further. Relative to the amount of resources already on plant, you get to colonize it basically for free. For something artificial you need to build it from scratch. Every single millimeter of it requires resources that need to be brought in from somewhere else. It's a complete waste.
Terraforming is an arduous process that really should take centuries. If you have the industry and tech to terraform a planet within your lifetime, building huge habitats jus as or even quicker is within your grasp.
In the Star Trek universe its more cost effective to find a habitable planet than building one yourself.
Almost as engaging as Kobali Prime
...