Proper testing would require a controlled environment that eliminates sounds other than those produced by the motorcycle being tested. Last time I looked that is pretty much impossible with a roadside test, and that alone will eventually result in those types of laws being overturned in court.
As for the plans that use an annual test and inspection with a controlled environment to get your registration or decal, that's a much better approach but in reality it's not likely to make any significant difference out in the real world. After all, how hard is it to put stock pipes on for the test, then ride home and put the louder than hades crap back on?
The government sidestepped all this emission catch-22 stuff back in the day by just ignoring the end user and putting the entire onus on the manufacturer. It takes a very feeble minded bureaucrat to think such a system will actually keep people from taking all the stuff off as soon as they get their new car or bike home, thus negating all that effort to reduce emissions (sound as well as air). They get away with it in the auto market because only a tiny percentage of people actually modify the emissions system or exhaust on cars. In the Harley market on the other hand, a huge percentage of bikes get aftermarket pipes and some sort of tuning device, often before the bike is delivered to the new owner. This is where the entire system goes straight to hell in a handbasket. As long as the aftermarket is allowed to sell products that allow people to defeat the emissions systems with impunity nothing will change. And when the government finally gets off it's duff and goes after a company, like they did with Power Commander some time back, the only thing that happens is that PC comes out with a new "street legal" version that of course no one buys, and they still sell the illegal version but get away with it by labeling it for "off road use only". Net result, nothing accomplished. The same is true of the aftermarket exhaust companies. It's also true of all the other stuff like the lighting products that do not meet government safety standards. Those four little words give all these companies license to thumb their nose at the law. Until that changes and the aftermarket gets the same heavy handed treatment that the auto manufacturer's did, the whole thing is just a joke.
Btw, rather than complain about the various localities trying to address these issues, why not place the blame squarely where it truly belongs. You know, on the jackasses who run around with unmuffled pipes in large groups, doing their very best to piss off the maximum number of people within a half mile radius. If all these juveniles with TDS (tiny dick syndrome) would grow up, there wouldn't be a problem.
Jerry