Are gyms really that costly to run that they can't sustain on a moderate paying userbase? I'm talking basic cardio and weight gyms, not the mega gyms with a pool and massage. The property might be prime but a lot of that comes to the choice of LA Fitness, 24, etc. choosing to build their own custom building in prime areas. Smaller gyms like Planet Fitness tend to use otherwise empty storefronts.
I think the idea is that if they had to build for their actual peak capacity, i.e. everyone showing up at once, they would not be economical. Of course, this is a silly hypothetical - the legislation is about making it more convenient to cancel your membership, not a guaranteed set of barbells whenever you decide to come in.
There are already gyms that do not cater to the people who buy memberships and don't show up. Bodybuilding and powerlifting gyms, for instance. They cost about 2 to 3 times more from what I've seen.