However, it's possible to have an HOA that just doesn't give a shit and does no enforcing.
It's already illegal to not do certain maintenance on your house (blight, etc.) especially if you have tenants living there. (tenant protection laws)
So enforcement is the key.
Almost every new/private development (as opposed to houses built along public roads or something) has one. That's how the resources to build up the common area are marshaled.
I think of the definition of "gated community" as a little squishy so I wasn't sure of absolutes. Now that I think about it more though, the "gate" part pretty much necessitates private roads as public roads would be open to the public. Kinda feel silly, "public" is in the name.
The HOA bill keeps increasing until it could be tens of thousands of dollars. When the landlord eventually sells the property the HOA is then able to get payment from the new buyer before the former owner receives the funds.
Since legal action is so expensive, this is almost always how the HOA eventually gets their money. Of course if the bill goes over 30k, then it might be worth their time to go through litigation to get their money.
And with that investment comes a more attractive property which commands a higher rent. And that means the housing becomes less affordable for the low-income renters.
There's no escaping the economics of it no matter how hard you govern it.
When you spruce up a house, that attracts different renters. The other renters will take up housing otherwise they wouldn't have bothered with, and it goes on down the ladder.
The argument that market rate housing causes lack of affordable housing is just not true. Look at San Francisco. They have strict zoning laws, laws against construction of market rate housing, and rent control laws. Is it a paradise for low-income renters?
So your solution is keep the place a dump to keep housing costs low?
If you want to get people in better housing, the real solutions require changing and influencing the people, not the housing.