HOAs started as a way to handle common infrastructure, like drainage. They allow a few homes to share drainage, without sticking all of the costs of maintenance to the homeowner who happens to have the pipe on their property.
In my case, my HOA carries property insurance for undeveloped land, maintains a grassy cul-de-sac, and maintains a fire road. (I personally spend about 2 hours a year trimming growth on the fire road because so many people walk on it.)
As far as saying that an HOA is to keep the loons out, we did have a hoarder live around the corner from the HOA. The people who lived across the street couldn't sell their home. (They had kids and wanted a larger house.) Could the HOA really do anything about the hoarder? I know the people who lived around the hoarder all put a lot of pressure on hee, the town condemned the house, and eventually it burnt to the ground. At least my with HOA, there isn't any good way to "evict" a loon who makes a mess.