Yes.. It's because of emissions standards.. And there is a formula for how many horsepower, CCs of the engine displacement for how loud it can be from the factory. Much of that goes out window when people buy the motorcycle. Often modifications to the exhaust is a desired upgrade.
Traditional mantra amongst the leather type bikers is... Straight pipes save lives..which from what I understand is summarized to translate.. If your bike is super loud other traffic will hear you coming, in turn they will get out of your way, be aware of you, and you are safer. In my experience shot loud exhaust does none of those things. Really loud exhaust does make it so you can't hear anything, on and off the motorcycle.. Makes whoever is the passenger also partake in hearing loss, general unpleasantness. And for people who ride any significant distances, really loud pipes, cheap helmets, that are noisy from everything including wind noise are a big contributor to fatigue. Aerodynamics are also part of it.. If your helmet doesn't fly in the air correctly.. You get off your motorcycle and feel like you were in a blast furnace noise wise, standing behind a jet aircraft engine while Mike Tyson beat you , head and chest for hours. I don't like moto mufflers that are fire extinguisher size but I like the noise less.