It's car racing in general that's the problem but it's small enough to be less significant than many other sports. It's more to do with the image of waste that it portrays to the world.
That's the factor that will lead to it's downfall. Probably already is, compared to what it was!
So you are about image, not reality?
You don't like golf but golf courses have the same environmental impact as an urban park and many of them are in urban areas. Would it be better to convert them all into more housing and commercial properties?
Skiing. How many thousands of hectares of forrest are cut down to provide ski runs in remote areas that can only be accessed by motor vehicles?
There are many sports that don't directly use fossil fuels which have bigger carbon footprints.
The world wide TV audience for F1 in 2019 was 1.9 billion people with 471 million unique viewers. Their social media followers were up 32% and their app had over 700 million views. 62% of new fans were under 35.
Racing will be popular as long as people drive their own vehicles. Face it, people will race anything, even lawnmowers. Formula E is also gaining popularity and will continue to do so as more people buy EV's but battery technology doesn't yet allow hybrid or ICE performance over anything other than short races. All except two of its races are on street circuits, not proper race tracks.
I do agree that the more old school types of racing such as NASCAR and Indy Car will need to embrace new technologies to remain relevant.