To be fair, you're comparing the amount of CO2 "produced" by the electricity generation of 1 kWh but your 2.37kg figure of CO2 from gasoline does not include CO2 generated from production of the gasoline in the first place, which would be necessary to do an apples-to-apples comparison (of just the "energy source generation/consumption" CO2) [0]
[0]: https://natural-resources.canada.ca/sites/www.nrcan.gc.ca/fi...