Also, setting up a good cycle lane can be more expensive than you think. If you have a nice bike lane that spreads over 5 km but there's a 200 meters gap in it because of a bridge which was too narrow to keep the bike path, then you don't have a nice lane at all.
Also, bicyclists in cities tend to travel closer to the speeds of cars than pedestrians, and tend to have more similar dynamics such as turning radius and stopping distance which infrastructure for cars is already designed around. Additionally, car drivers are licensed and there is an expectation of awareness that they must exhibit. This makes it far easier to place slower-moving "hazards" in their path than adding faster-moving vehicles in the path of pedestrians.
https://www.sallymorinlaw.com/bicycle-accidents/riding-your-...
Some areas have long stretches of sidewalk without intersections those are fine for cycling assuming they have little pedestrian traffic or are wide enough to pass safely.
Most sidewalks aren't appropriate for cycling. The exceptions I was describing are mostly found in big commercial developments, target, walmart, etc. Around me they tend to build wide sidewalks, well separated from the busy road. Here's an example:
https://www.google.com/maps/@38.9146941,-92.3196647,117m/dat...
But most sidewalks aren't like that they are crossed regularly with driveways and end at a road every block. Every driveway is dangerous because drivers just don't look for people moving at bike speeds(2-3x faster than a pedestrian) on sidewalks. I personally know two people hit while cycling on a sidewalk because somebody pulled into a driveway and didn't see them.
Imagine you're a cyclist, on the sidewalk, trying to cross a four-way stop. If you cross at the sidewalk, you're at extreme danger of being hit by a car making a right turn. This is called a right-hook.
The road infrastructure in the US was built without consideration for bikes and so it's really annoying to many drivers when cyclists use roads but that doesn't mean the right place for cyclists is on the sidewalk.
I wouldn't want to bike when there are many cars in the same lane as me, but it is still safer than biking on sidewalks where are many pedestrians.
* It tends to be busy with pedestrians (not everywhere, as you mention)
* It's not safe when crossing side-roads
* It's inefficient if you walk at junctions
I have had more close calls with cars riding on at most 10 miles of sidewalk (and that's being generous to be honest) in the past decade than with ~6000mi riding in the road.
Also, the width and amount of obstructions on sidewalks varies widely.