Gyms have high fixed costs and low marginal costs. You don't cost them very much money every time you go.
You do cost the gym money every time you go. But only after a certain point (anything more than light use) and if you go at peak times.
Basically, the space you take up at peak time is another membership they can't sell because of potential overcrowding.
Is that really a thing? I've _never- found a gym that has said "no sorry, we can't sell you a membership because we're full"
(On the other hand, I'm pretty sure more people skip going to the gym than skip going to a movie!)