Yup, it’s illegal. So is driving / parking in the bike lane, but the cops in my city enforce neither. Doesn’t change a thing — I refuse not to be selfish when it comes to protecting my life.
Something being assumed here is that in the US, we have pedestrians on sidewalks.
In truth, you only see this in large urban core areas, but in most places, even the suburbs, people don't walk anywhere - mainly because in many cases, there's nothing nearby to walk to.
Everybody drives.
That isn't to say nobody walks, but such people are few and far between. Usually, when you see someone on the sidewalk, it's either a skateboarder, a bicyclist, or someone in a powered mobility chair.
This does, of course, vary based on the population and geographical makeup of the area (and weather), but usually, again, the only time you see more than a few people walking on the sidewalk, it's within an urban core area.
Also - speaking on the weather topic - here in Phoenix, Arizona, we don't typically have many walkers on sidewalks in the downtown area, in the summertime, because the heat is extremely brutal (even with shade). At one time, it was also a year-round thing, because there wasn't much to do downtown (and shops closed early), but things have changed in recent years (mainly due to the install of light rail).
I mean, I’m not a moron. If the sidewalk is crowded, I’ll hop off and walk my bike.
But it’s a false equivalency to compare the two: a bike vs pedestrian accident usually ends in bumps and scrapes with the cyclist getting the worse end of the bargain. A car vs bike accident can easily leave you permanently disabled or worse (with a very high frequency of hit-and-runs).
... endangering pedestrians.