For the same reason why very few companies are worker owned co-ops: people suck and capitalism doubly so. That’s why we very rarely can have nice things.
In the case of HOAs, the bad ones (which are the vast majority of them) exist to extract profit (in the form of increasing property values, fining anyone who doesn’t follow their petty rules, and sometimes even take someone’s home for breaking the aforementioned rules) and exert as much control over people as possible.
In the US at least, laws regarding HOAs are a grotesque combination of under-regulation and regulations specifically crafted to FACILITATE abuse rather than discourage it.