During the trial it was revealed that McDonald’s knew that heating their coffee to this temperature would be dangerous, but they did it anyways because it would save them money. When you serve coffee that is too hot to drink, it will take much longer for a person to drink their coffee, which means that McDonald’s will not have to give out as many free refills of coffee. This policy by the fast food chain is the reason the jury awarded $2.7 million dollars in punitive damages in the McDonald's hot coffee case. Punitive damages are meant to punish the defendant for their inappropriate business practice.
And what makes capitalism superior to any other form of resource distribution that humanity has tried so far is not that it does or doesn't allow greed, but it lets the greedy use their greed in a way that has at least the potential to benefit the many. And by having a legal avenue for greed to be used, capitalism forces greed to the surface and makes it legal for everyone to discuss.