How is it not? It takes a huge amount of energy to manufacture a battery pack (you spend about the first 1/3rd to 1/2 of an EV's life paying off the "CO2 debt"), and it generates all sorts of pollution in the process.
Electric and ICE vehicles both have both of these costs. They are all different. If you want to compare things, you need to actually look at all four numbers, not take two unrelated numbers and comparing them for dishonest reasons.
Edit: It takes 25MWh to manufacture just the battery pack for a Tesla, or about 18,000Kg CO2 (assuming a 0.6Kg/kWh CO2 ratio for the Chinese power grid, which is a very optimistic number).
Assuming the power grid where the EV will be used is 100% sustainable (which is very very far from the truth), given that the CO2 output for gas/petrol is 0.3kg / kWh or 2.3kg / liter, and assuming an average of 35 mpg or 7.7 miles per liter, as well as adding a factor of 1.5 to account for refining, storage, and transport losses (which I think is very generous) you would have to drive your new Tesla for around 40,000 miles on 100% renewable power before you've paid off the increased CO2 debt of its manufacture over an ICE. That mileage, by the way, is the number of miles the petrol-engined car would have to drive to produce the 18,000kg CO2 that it took to manufacture the EV battery pack. I am also assuming that the manufacturing cost of the rest of the EV is comparable to an entire ICE car, which I think is fair, as EVs generally contain a lot more electronics (which are very energy-intensive to manufacture), as well as at least one electric motor. An ICE is basically a lump of metal, which has a surprisingly low relative cost of manufacture.
The UK has a relatively "green" power grid, for a developed country, and even here, the difference in CO2 output between the grid and an ICE is so small, you would basically never break even in overall CO2 emissions between an ICE and an EV. For reference, the calculated CO2 output of the UK grid is 0.23kg/kWh.
Also, just for fun, the embodied energy of a 1960's Fiat 500 (assuming its entire 500kg weight is made of steel, which is probably a good enough approximation) is 3MWh, or three laptops.
So what is more sustainable? Claiming that I am making an "dishonest comparison" just ignores the issues with the "green maths" of EVs.
Greening up the energy sources for vehicle production should just be next on the agenda!