You have fallen prey to the
You have fallen prey to the "MPG illusion" and have reached factually incorrect conclusions on CO2. Search google for Berkley MPG illusion.
Yes, burning diesel does produce more CO2 per gallon than gasoline (19.64lbs of CO2 per gallon of gasoline and 22.38lbs of CO2 per gallon of diesel) but that is more than compensated for by the increased efficiency of diesel engines.
Here’s a case study: a golf TDI with 36MPG diesel vs the golf GTI with 28MPG gasoline.
So if you drive 100miles in these two cars and achieve the rated mileage you will have burned:
3.57G of gasoline which yields 3.57*19.64=70.14lbs of CO2
2.77G of diesel which yields 2.77*22.38=62.17lbs of CO2
The "green reputation" of diesel engines is well deserved as the case study above shows that for every 100 miles the diesel engine prevented the release of about 8lbs of CO2 (a greater than 10% reduction).