There is a theory in economics that the government could do this by imposing taxes on negative externalities.[1] The purpose of these "Pigovian taxes" is to make society whole for these negative externalities and ensure that over time the prices of goods reflect their total marginal costs, not just the direct costs to the producer. Of course there are practical problems in estimating the right level for these taxes accurately.
It’s not a theory for any meaningful sense of the word theory. The government could indeed price in externalities through taxes if it so desired. Also it’s not “Pigovian taxes”, it’s just Pigovian taxes. That’s exactly what a Pigovian tax is. No need for quotes here.
Taxes are regularly used to encourage or discourage investments. The fact that no government does is a political one.
To be clear, when I say theory, the theoretical part is not that these taxes could exist but that the tax could adequately price in negative externalities, which is hard because generally price discovery is hard to do and in particular one of the things about the negative externalities of lots of activities is they are not fully known at the time the goods are produced. eg when the would was going ham producing asbestos it was probably not fully appreciated quite how harmful that was. So lots of the information which would be the raw material for that price discovery is unavailable.
Governments do sometimes impose pigovian taxes and as you say, this can be politically unpopular which is why they don’t always stick. For example, in the UK there was the “fuel price escalator” which was a direct response to climate change. The government decided to impose a tax on retail petrol and diesel prices that would rise in line with inflation or faster to encourage people to move away from fossil fuels over time. It led to a weird uprising where truck drivers picketed oil depots and the country ran out of fuel so the escalator was abandoned.[1]
[1] https://www.economicshelp.org/blog/glossary/pigovian-tax/