Sort of. They function just like another layer of government, but the problem is that they're not actually part of the government, so they don't have checks and balances and they're not held to the same standards.
And in theory, HOA's compete with each other. One HOA with a $500 monthly fee will likely be outcompeted by a neighboring one with a $20 monthly fee (all else being equal)
You -> HOA -> City/Town -> State -> Federal
You pay fees and taxes to all of them.