HOA is a restrictive convenant of home ownership.
It's origin lies in desire to restrict ownership of houses in a subdivision, such as no jews, no blacks and no asians. Racially based HOAs are declared illegal by 1948's court desicion Shelby v. Kramer.
Outside racially restrictive use, after 1960s HOA were popularized when populations moved out of city into suburbs and many subdivisions are newly developed, making HOA easier to impose.