Some might say that this is a function of government -- that is, the collective will of society forcing corporations and/or individuals to take into account otherwise hidden externalities. Though this is a somewhat contentious view, it makes sense to me.