If it was about greenhouse gasses they'd let you keep the "dirty" car because the extra pound or two of emissions per gallon compared to a new car doesn't offset the carbon cost of building a new car from scratch.
This is essentially a highly regressive tax scheme that subsidises auto makers and dealerships at the disproportionate expense of poorer working Americans. It gives auto manufactures a "replace car" light that they can activate and have enforced by law and thus, planned obsolescence.
As someone who grew up poor and has spent time not having access to food in order to replace a useless sensor in a family vehicle (or paying a fine related to not having a valid inspection sticker) and knowing many other families who have been in the same situation. I have seen first hand the issues with this policy.
As for "ripping apart the dashboard" to get to the "useless" sensor, what kind of car was this?
ODBII regulations for Highway Vehicles are what prevents the bulk of it today. ODBII does not apply to non-road vehicles like Tractors.
However Automanufacturers are moving anything that is not required by ODBII (which was passed in 1996 so it very out dated) to CANBUS and disallowing 3rd parties access. This makes is harder for Independent shops to service some of the non-mechanical parts of the car like the GPS, Radio, power seats, etc