There is a purpose to home owners associations, even if it comes at a heavy price. These half-government, half-corporation hybrids emerged in response to the rise of American suburbs, where the actions of one homeowner substantially impacted the others.
The precursor to HOAs was zoning regulations. However, the limitations of zoning, which was a function of local government with varying political interests, gave rise to the creation of a new private organization: the HOA. Now regulations outside of the power of government, such as tree height, house color, parking rules, could be imposed by a legally private authority.
A large reason HOAs started being established in the 1960s was for the benefit of developers. When building a subdivision, they could put in place an HOA to govern the area before the first residents even moved in. Local governments were also keen to give up some of their less popular responsibilities and financial ties.
HOAs are structured much like corporations, with the property owners being analogous to the shareholders. The Board of Directors is democratically elected, and changes to the HOA bylaws must be put to a vote. In theory at least, the members of the HOA have control over their private government by the same principles of self-governance applied to the U.S. constitution. This also allows for a great variety of styles of HOA, with some extremely lenient and some very strict.
University of Maryland HOAs in Historical Perspective: http://www.publicpolicy.umd.edu/uploads/cms/faculty/nelson/private_community/par_article_aug_2011.pdf