Easy example is BP oil spill. You'd think it would be in their best interest to double up on safty because a spill would cost massively more than the safty precautions to prevent it. You'd think. But we see that they take risks and cut corners to meet their deadline while disregarding safty.
http://www.npr.org/blogs/thetwo-way/2012/02/06/146490064/rem...
It's not exactly the same situation but I think it illustrates the need to have independent oversight from someone outside the same management hierarchy – otherwise it's just too easy to cut corners, particularly since the feedback usually isn't immediate.
A closer analogy would be the fallout to both McDonnell-Douglas and the FAA after a series of DC-10 crashes. These crashes doomed the company, and they were sold off to Boeing.
The problem was that they perceived the risk of perceived flaws as high enough that they chose not to act. Market incentives aren't always as simple as they might seem at first glance.
If an airliner gets grounded, people who have already flown on it aren't retroactively at risk, so the worst case (other than the one that actually crashes, of course...) is that some airlines have some very large, very expensive, paperweights.
To Boeing, a 787 with a safety record so terrible that nobody buys it is equivalent to a 787 that ships so late that nobody buys it.
When presented with a choice between risking a terrible safety record and the certainty of shipping late, which do they choose? In a case like this, from a purely financial standpoint, a company would choose to risk safety, and would be completely rational to do so.
The public would prefer a 787 that was a certain failure to one that was a potential deathtrap, but Boeing's incentives aren't necessarily aligned with the public's desires. This is why we have regulation.
All else being equal, Boeing certainly does have an incentive to improve safety, as you point out. But it's far from their only motive, and in many cases it won't be the strongest one.