Dumping the entire burden of enforcing community conduct on the nominally democratic-republic municipal government is exactly why those governments exist. That's what they're for. City ordinances can be changed if people don't like them, or struck down by the courts if they are outright illegal.
HOAs are all about making little insular villages with none of the actual infrastructure necessary to support one, such as schools and parks and fire trucks and businesses that generate noise and traffic (and money). That is itself cutting corners to make everything as cheap as possible, and leaving the buyers holding the bag. Do you want to be part of the city that actually provides those things, or do you want to be continually subject to nasty letters for having a dandelion in your yard, just because the home building company stuck that clause in there as a marketing gimmick for the bermudagrass-monoculture lawn snobs?