Diesel pollutants breakdown into two general groups:
1) Smog forming pollutants like NOx and Ammonia stay in the region they're produced. They negatively affect air quality and hurt people with breathing issues like asthma or COPD. US regs focused on NOx reduction over GHGs. This lead to cleaner air, likely at the expense of the environment.
2) Greenhouse gases like CO2, Methane, etc rise higher into the atmosphere and spread more globally than the smog forming pollutants and have more environmental concerns. These are the focus of climate activists. For a long time European regulations focused on GHG reduction over NOx and the air quality in their cities suffered a bunch as a result and humans suffered. (US and Euro regulations now have much more overlap focusing on both smog forming and GHG emissions).
If you reduce the emissions output one category or particular compound, it often results in increases in one of the other compounds. For example, lean burn will reduce fuel consumption and GHG emissions, but it increases NOx and hurts air quality. If you increase fueling to cool the combustion, then you reduce fuel economy and increase sooty particulate emissions. There's a very delicate balance that OEMs have to strike depending on the application and region where it will be sold.
I pay my bills doing emissions systems development on diesel engines. My company spends literal billions of dollars each year on this stuff to make sure they're compliant with regulations while still offering as much quality and performance as possible. Jim Bob with a laptop isn't doing anything better when he illegally defeats emissions systems. He hasn't figured out a trick to make them cleaner than the OEMs and there's no secret piston design that OEMs are ignoring that would prevent the need for DPF/SCR/EGR systems. If there were a simpler, less expensive, more reliable way to meet emissions regulations without completely neutering the engines OEMs would sign up and pay handsomely for the privilege. If you've got better ideas, and can prove that they work, it would literally be worth hundreds of millions of dollars per year.
There's actual proof that these regulations have cleaned up the air and water. And there's actual evidence that diesel engines have gotten far more powerful since emissions regulations have been enforced. That's not a coincidence. A modern diesel that's had it's emissions systems defeated can easily have tailpipe emissions equivalent to hundreds of stock diesels. They're often worse than the old diesels that had no emissions systems at all. It's no joke, and the "coal rollers" have abused the situation and made it visible enough that it's become a high priority. It's been a priority for a few years now, and it's going to spread into a lot of areas.
All that said, nothing is perfect and these emissions systems are no exception. Lots of people that have issues should probably be buying a more appropriate tool for the job. I see lots of trucks and buses switching to other fuel types around here, and my company is investing heavily into alternative energy options and non-diesel fuels that require less hardware to meet emissions regulations. Diesel is a dirty fuel by nature, and the regulations only get tighter with time. It's going to be decades before diesel is replaced as the primary fuel of "work", but it's being used less and less every day as people choose alternatives.