Those fees are for a lot more than gym membership. Take a large building - have you ever looked at the maintenance costs for something like that? If you haven't the good news is that annual budgets and statements for the past x number of years are publicly available for these associations (at least where I live that is true). Before you buy a place, a good realtor will walk you through the association's finances and give you an idea of how well the property is managed.
One issue is that developers will often set an attractive low rate to sell the initial units, and it doesn't get appropriately adjusted as the building ages. Then down the road, when expensive stuff (roof, elevators, etc) need to get fixed or replaced, there isn't enough capital banked and the fees spike dramatically.
At my complex, the majority of the HOA dues are going to elevator and roof repairs (or rather, going to replenish reserves that were depleted due to those repairs)
Some of the money also goes to utilities (water, sewer, trash) which I suspect are cheaper to do communally than individually