What if that's the way the people of that neighborhood want it? What if the HOA was for weed and animal management or some other purpose? The IRS is not in the business of deciding what neighborhoods should look like.
An HOA is considered a normal ("for profit") corporation unless it qualifies as a "non-profit" corporation under Section 501(c)(4) of the Internal Revenue Code. In order to qualify as a non-profit corporation the HOA has to demonstrate that a substantial part of the common areas owned by the HOA are for public use. In almost every case this involves public streets, sidewalks, bike paths and park/recreation areas, though public parking areas would also qualify if the HOA even allows parking for the general public.
Very few HOAs qualify as a non-profit corporation, because of the way master deeds restrict usually restrict the use of common areas to the owners and their visitors.
In this case, the HOA was either poorly advised by their legal and accounting professionals, or they were running a tax-evasion scheme to hide the corporation's income from the IRS.
I'd also speculate that this has been an item of dispute within this particular HOA for some time, and the HOA management may have been reported to the IRS by one or more of its own members.