I believe, as you said, diesels also have lower CO2 emissions per mile than gasoline engines. The problem is the increased SOx and NOx emissions as well as soot emissions that contribute to smog.
In theory, Diesel engines should have much lower smog than gas engines because Diesel engines require excess oxygen rather than stoichiometric ammounts like in gas engines. The problem is that diesel fuel doesn’t vaporize nearly as well as gasoline, so you end of with tiny droplets of diesel in the engine rather than pure vapor. So even though there is excess oxygen, the O2 can’t get to the inside of the droplets and the engine heat basically cooks them into soot.