Speaking for CA: to drill a new well the company must post a bond that is returned when the company closes the well.
If they don't, the bond is used to close the well.
Problem: the cost of the bond is WAY lower than the actual cost of plugging the well. So companies abandon them, and there is seemingly no penalty.
So society pays for it.
> California’s oil wells cost an average of $68,000 to properly plug and clean up once they are done producing. However, the average bond currently available to cover those costs is only $1,000 per well.
From https://environmentamerica.org/california/resources/mapping-...