When it comes to my favorite stocks, sometimes I feel like the cartoonish capitalist depicted in the board game Monopoly. My initial instinct is to callously ignore the consequences of these companies’ actions so long as their profits are growing, dividends are rising and share prices are climbing.

Exploit all the loopholes. Extract all the resources. And do a half-hearted clean-up.

But even from a selfish perspective, such an attitude can be short-sighted. After all, these depredations court headline risk, and eventually legal and regulatory risk, which can cost shareholders dearly.

And I’m not a total monster. On a human level, I hate seeing others harmed by a company’s negligence, no matter how much I might love its stock.

But when a company is big enough, bad things inevitably happen.

One particularly illuminating exercise is to check the legal proceedings or litigation section of your favorite companies’ quarterly financials.

On second thought, don’t do that–it might freak you out. That’s because many companies often have multiple actions taking place simultaneously on the legal front.

Hence, the reason this sentence is practically boilerplate: “We may, from time to time, be involved in litigation and claims arising out of our operations in the normal course of business.”

Sometimes it takes a really bad thing to force a company to acknowledge its shortcoming and start doing the right thing. An individual company’s wake-up call can end up being a wake-up call for the entire industry, prompting other companies, some of which may also be portfolio holdings, to act before their own reckoning.

And if a company is big enough, then the financial blow need not be fatal.

That appears to be the case with Duke Energy Corp. (NYSE: DUK). In February of last year, one of the company’s 36 coal-ash impoundments leaked 39,000 tons of ash into the Dan River, turning it an ominous shade of gray, while posing a threat to local water supplies.

Duke’s coal-ash spill was the third-largest in U.S. history, though it’s dwarfed by two previous coal-ash spills by one to two orders of magnitude. Although ash reportedly lined the Dan River for up to 70 miles, thankfully the river itself is so vast that its volume helped dilute the contamination to safer levels.

Subsequent investigation revealed leaks at the company’s other coal ponds along with groundwater contamination. Consequently, North Carolina state lawmakers passed the Coal Ash Management Act last August, requiring Duke to close all of the 32 ash ponds it has in the state by 2029.

In April, the Environmental Protection Agency (EPA) issued a rule giving it oversight of coal-ash ponds, which had previously been regulated by states.

Last month, Duke pled guilty to nine violations of the Clean Water Act and agreed to pay $102 million in penalties. Four of the criminal charges were from the original ash spill, while the remaining charges resulted from leaks later discovered at other sites.

Finally, earlier this week, Duke announced its plan to excavate another 12 ash ponds in North Carolina and move the waste to lined disposal sites. That brings the total number of ash ponds that will be removed to 24.

Meanwhile, the company is looking into whether the other 12 ash basins need to be moved or can be safely capped in place. These remaining ponds account for the majority–about 70%–of the 108 million tons of coal ash Duke has in the state.

In prior coal-ash spills by other utilities, the cost for clean-up and other mitigation efforts has typically been borne by ratepayers. Duke has said the total costs related to the initial spill came to $24 million, and that it would not seek to recover these costs via rates.

But there’s some debate over to what extent the costs for cleaning up the other ash ponds will be borne by shareholders versus ratepayers.

The aforementioned state legislation imposed a moratorium on Duke from seeking any sort of rate increase related to the clean-up through mid-January this year.

But last week, the ratings agency Fitch upgraded Duke’s credit rating, in part reflecting the “significant, albeit manageable” coal-ash clean-up costs, as well as its expectation that the costs incurred will be recoverable from ratepayers.

Duke has a long history of constructive relations with state regulators, so it may very well persuade them to permit such cost recovery. On the other hand, the extraordinary media scrutiny regulators and local politicians endured in what ultimately became a national story could cause them to take a harsher approach than they would ordinarily, which could mean shareholders would bear the cost here too.

The company has set aside $3.5 billion to deal with the clean-up, though it had previously estimated excavating all of its 36 coal-ash ponds would cost as much as $10 billion.

Clearly, the market believes Duke will recover costs via ratepayers. The stock hit a high at the end of January, before the general correction in utilities sparked a selloff. And over the full period since the initial spill was discovered last year, Duke’s shares are essentially flat.