Yes because electric cars can use renewable energy, petrol and diesel cars cannot.
Key word being can. You're right that a lot of people charging at home are buying coal/gas power to charge their cars, however a lot of people are also charging with renewable power. Some people are charging exclusively with renewable power. And that number is only growing.