Is this legal?

Yeah, it's definitely true that HOAs vary widely - some of them are downright mental and oppressive, others strike the right balance among a few, uncomplicated interests.

I have lived in two different HOAs and neither was problematic in any way.
when my in laws bought their house in 2013, their HOA was one of those where at the meetings, there were always people inches away from fist fights.
One lawyer on the board fining another lawyer for whack things because he beat him a big case.. lawsuits after lawsuits for every little thing. finally they decided to turn it over to a third party company. since then, its much better.