The diesels of that era that were having to trick the test, were also orders of magnitude cleaner than previous diesels, and modern diesel tech nowadays does meet those standards that they couldn't meet at the time. Moreover, the diesel trucks and buses are held to a different standard and pollute massively more than the dieselgate vehicles.
Ultimately diesel engines are much more efficient than gasoline engines, and massively reduce CO2 emissions... arguably the biggest health and existential threat humans face today. I think modern diesel/electric hybrids running clean burning renewable diesels probably have less environmental impact than any other type of vehicle on the road today. It's a shame that dieselgate ruined this for us, because it would probably be widespread if not.
For example, the VW XL1 was sold to the public getting 260mpg with ~2013 diesel tech- about twice the 'MPGe' of the most efficient production electric cars, and it can burn carbon neutral renewable diesels. Supposedly these produced 21 g/km of CO2, or about 1/6th of the effective CO2 emissions of EVs in the USA.