The thing is that cars have a huge secondhand market.
So if you buy a new car, you sell your old one to someone else, who sells their car to someone else, who sell their car to someone else, ... all the way until one of the horrible gas guzzlers at the bottom gets finally replaced.
So in a way it is improving the environment if you look at the whole picture.