This is true because electricity is still largely generated from fossil fuels. We're running out of those. So, we're dealing with multiple issues here (not necessarily in order):
1. Replacing fossil fuels. This has to happen, regardless of environmental impact. They're going away, likely in our lifetime, even
2. Using whatever alternative we come up with to generate power (electricity seems to be the way we're headed)
3. Reducing the carbon footprint
This is also without addressing the power grid infrastructure challenges EVs currently face. The CO2 thing is worth bringing up, but it's specifically poignant to bring up when somebody says they "bought an EV for the environment". That's when this info becomes a strong case. It's not better for the environment yet. Not until we replace fossil fuels.