The electricity needed to power electric cars probably isn't produced by solar/wind/wave/etc, and probably isn't completely clean. And it might be a less efficient use of resources to burn oil in a power plant and then use it to charge a battery and then use that to drive a car. There is still a big advantage to doing this.

Power stations are huge, and in a known location. Cars are small, and all over the place. Power stations have massive reprocessing facilities, exhaust scrubbers, etc. etc. Cars have, at best, a catalytic convertor. Even if the power station is burning more fuel, it gives off less pollution. Best of all, you can put a power station in the middle of nowhere, where it can't poison anything. To be useful, cars have to be where people are.

If electric cars can ever be made to work, it would put an end to pollution in built-up areas, and make cities more pleasant to live in. No wonder California wants zero emission vehicles so badly...