Big cities like Tokyo or Osaka are walkable; outside of them, Japan quickly devolves into very pedestrian-unfriendly urban sprawl (I know because I live in one such place). But somehow you still find plenty of vending machines everywhere, even besides a road in an otherwise empty field.
Especially the model of renting shops to fill them with vending machines seems to be getting popular. They regularly get into fights with the city whether they have to obey the legally allowed opening times for stores or can be open 24/7. That and farm shops putting up vending machines.
Also, what we would call non walkable suburbs or rural areas in Japan have more vending machines than anywhere in America as well.
Japan is also extremely tiny compared to the US.
Japan is also something like ~70% mountainous where things cant even be built.
It also helps a lot with planning/building if parts of your country were bombed into oblivion and gave you a chance to rebuild and rethink everything from the ground up.
Hahaha, now this is a good joke. Japanese cities are notoriously chaotic and urban planning is almost non-existant; my guess is that they didn't rethink anything, they just rebuilt everything in a hurry, and afterwards, shoganai.
Any technical or laws difficulties is just the "easy" part