Running a car on idle for a long time basically slowly degrades it. It's just sitting there getting hot and wasting gas. Without adequate cooling, the engine will overheat. And if you have multiple catalytic converters, the car can explode from built up gases. Many manuals explicitly state not to idle the car for more than 10-20 minutes.
You don't even need to idle it. Many cars today have automatic engine shut off and start when the car is stopped at a red light. New cars could easily add this to prevent idling.
Now consider the non-technical reasons not to let it idle. One, someone can steal it. Two, it's wasting gas. Three, it's pumping harmful gases into the atmosphere and creating smog. Four, someone could die from carbon monoxide.
The solution is simple. The default should be to turn off the car if the keys are gone after idling for 10 minutes, with an override switch to let it idle for, let's say an hour. After an hour you have to flip the switch again.
Regardless of whether you think this is necessary, there are hundreds of such modifications already that add up to make cars safer and more reliable. You can't switch into or out of park or reverse without depressing the brake. You can't remove the keys without being in park. Your can't operate Bluetooth controls while the car is in motion.
So it's not like these changes are new or difficult. Automakers add them over time as they see the need. But when they don't act, it's up to us to pass legislation to require them.