Interestingly, places that are dense and friendly to walking and bicycling are actually extremely popular with home buyers and renters. These places have seen prices and demand skyrocket, yet building more of them is often against zoning or other planning guidelines.
It's starting to change, many places are starting to convert to denser and mixed-used zoning and remove minimum parking requirements, but it seems to be happening slower than market demand.
You might be able to build a tiny little enclosed block, but you couldn't also have business there too because of zoning.
I still think it'd be possible to build a neighborhood where the HOA bans driving cars. Yes, it'll still need roads for emergency access (which you'd want anyway, fire trucks and ambulances do need to get in when needed).
If there are minimum parking space rules in the area that's a bit annoying but shouldn't be a showstopper. Just because the parking needs to be present doesn't mean it needs to be used for that purpose, so the HOA can still ban cars. You can then use that driveway for projects, play space, etc.
I don't see how it can be illegal?
HOAs have extreme power and already impose all kinds of overbearing rules on people subject to them. So you could surely get together with a few hundred likeminded people and build a neighborhood where the HOA prohibits cars.