I don’t believe this to be entirely the case, having served as President of a HOA for 10 years. HOAs are generally incorporated and hold said property. Should the Mandatory HOA be banned, the corporation could simply switch to private membership and offer access to amenities to those outside the community. If the residents don’t want that, they’d need to pay up. Condos, however, likely have different needs because of shared construction, but I’m certain a solution for that could be found.
I absolutely HATE living in an HOA for private property reasons; I don’t enjoy being told what I can do on and to my own private property and being bound by decisions other people make about my own private property. Things like being forced to use a specific (terrible) trash service and specific lawn care company (charged at 2x what I pay for lawncare with 4x the property), which are things friends complain about in nearby communities.
However, I also fully understand their value for communal property/amenities and see nothing wrong with maintaining mandatory membership for those features. The biggest problem is that those costs continue to be inflated in the HOAs around us, and now our own after I stepped down. For many of them it is the unnecessary improvements or using a board members cousin contractor, or a member, who charges 1.5x while providing .5x the value. That, or it gets turned over to a management company that takes a 30% cut and milks the budget with their own in-house contractors doing a similar overcharge/underperform thing.