Because 'custom' bikes are currently popular with a generally affluent and older population, the noise issue seems to be overlooked.
Nuisance laws (like height restrictions on trucks and cars, fender flare requirements, noise requirements, licence plate lights, etc) can be a legitimate way for an officer to pull over a driver (or rider) who may not be doing anything wrong, but just 'looks wrong' -- without saying they're profiling.
This allows the officer to get a closer look at the driver, and check out more important things, like licence, insurance, driver sobriety, etc.
If a loud vehicle is ridden by a middle aged clean cut person, they probably won't get pulled over. The same bike with a sketchy-looking rider may get more attention from officer friendly.
Is it right? I don't think so. I think laws should be applied the same for everyone -- until it comes to something I do (like speeding a bit) gets me pulled over, then I might change my tune!
Personally, I don't like the loud, poorly designed and improperly tuned bikes that seem to be all the rage today. But I know from experience that it's a fad, and it'll pass. Maybe in a few years we'll be complaining about too-bright nano-paint at night or something else?
-------
Loud pipes a safety issue? Then I assume this uber-safe rider with the loud pipes is also wearing brightly colored gear from head to toe, a full-face snell approved helmet, and has taken not only rider training courses, but advanced riding safety courses every couple of years. If not? Then the pipes are a fashion statement.