They are arcology skyscrapers (cities within a single building).
My theory is that they are residential, used for housing for the Riverside Shipyard workers as well as lodging for visiting starfleet personel and for cadets on route to the academy.
Riverside, Iowa today is a small rural community of about 1,000 people. In Kirk's time it is a major industrial community with the shipyards and the Iowa Mining Company quarry. The Star Trek movie novelization states that Kirk himself grew up in a farmhouse and the car chase and bike scenes show there is still plenty of open farm land around and it isnt uniformly urbanized.
Perhaps as a way for the residents of Riverside, Iowa to preserve their small town and rural lifestyles the community commissioned the construction of the arcology outside of the old small town closer to the shipyard so that most of the newcomers to town would live in the skyscrapers and the old town would be preserved, thats why there is still much open land there, the new residential was built vertical instead of sprawling across the landscape.
The shipyards must employ thousands and thousands of workers not to mention all the visitors and these arcologies are full service communities to serve them. I am sure in addition to residential housing and lodging there are grocery stores, retail shops, restaurants, recreational facilites, indoor swimming pools, etc, pretty much everything you would find in a large luxury residential high rise in a big city today and then some.
Pardon me for giving such an in depth response but I am an urban planner and thus I think about such things.
