Those aren't "planning" codes, it's more rules and guidelines. Development is still largely free and left to the market so long as they stick within the guidelines.
It's those rules and guidelines that make suburbia so miserable though. When you can't build retail without 1 off-street parking spot per 100 sq ft or new residential without 1.5 parking spaces per bedroom, then there is no possible outcome other than the car-dependence we see today. Parking requirements make building a walkable town impossible.
Car dependence comes from the low density infrastructure. The rules are a consequence of that. Low density infrastructure exists because many cities were built during a time when car companies were trying to make the automobile mainstream.
Density is limited explicitly by code. It's limited implicitly by parking requirements which are code. Car dependence also largely follows from segregation of uses (residential and retail can't mix) which is again code.
That's too simple of an answer. These codes did not exist until recent times. The codes actually exist because people wanted them to exist, because car culture influenced the way people think and how they should live. All these codes were put into place AFTER low density infrastructure was already the established norm.
You can see it in how cities are built this country. Cities established in the east before car culture took over are much more walkable and have a different set of "codes"
Part of the problem is that presently walkable cities don't have walkable codes, so as they expand or even replace old buildings they become more car centric. They are only walkable because current buildings are from prior to the adoption of the code. The Illegal City of Somerville [0] brought popular attention to this a few years ago.
I don't know why you insist on putting scare quotes around the words "planning" and "codes." In municipal governments all across the country, people who went to school for "Urban Planning" and have the job title "Planner" work for the "Planning Department" and administer the "Planning Code." These the canonical, legal names.
I put quotes around them because they aren't actually planned. They're officially and canonically called "planning" codes but no real long term urban planning is involved. It's more short term satisfaction planning and not the kind of actual planning that goes on in other places like say China or Tokyo. Now you know why.
>Part of the problem is that presently walkable cities don't have walkable codes, so as they expand or even replace old buildings they become more car centric
Unlikely a city doesn't convert a high density building into a low density building because of a remodel. People really need to leave the city in droves for this to happen.
What you're referring to is NEW cities or new expansions.
Somerville is like a one off. It's also not really a walkable city like Tokyo or Hong Kong is. It's more like a walkable town or village.