Cutting connectivity to a neighborhood to prevent through traffic is good for the neighborhood on the net, bad for everyone else... and the law is quite permissive at allowing it.
Our roads are designed so that some are arterial, some are access. The designs of these different kinds of roads are strikingly different, the costs to construct them are strikingly different, as is its durability to traffic. The impact on the surrounding properties are strikingly different as well.
Treating each kind of road according to its designed purpose is not a failure to treat the public equally.
Would you also argue that prohibiting drivers from traveling southbound in the northbound lanes is not treating them equally under the law? -- I suppose not.
But then why do you consider directing transit traffic via non-arterial roads, causing unplanned wear to the road, risk the the surrounding properties, and congestion at interconnection points to be materially different than driving the wrong way? The road is designed to be used a particular way, using in a manner contrary to the design can cause serious problems.
The law does not currently have carveouts for prohibiting transit traffic on public roads, as they weren't generally needed in the past and no doubt their enforcement would have their own costs (e.g. police stopping people to ask where they are going)... but such laws could certainly be created, and will be created if mapping companies continue to insist that they can ignore the harms they are creating by directing drivers to drive in ways contrary to the design of the road network so long as the law doesn't outright prohibit them from doing so.
With automatic plate number recognition cameras it would be relatively straight forward to automate ticketing of through traffic in posted no-through roadways...