Also with a "big evil" you can tell yourself that removing that evil would solve everything.
I use housing as a good example since it's been a major driver of inflation and most houses are sold peer to peer on the open market. If you're selling your house and you see comparable houses selling for $900K, but you only need $750K to earn enough profit to buy your next house, what are you going to do? Sell for the lowest price you can afford? Or sell for the highest price you can get? You'd sell for the highest price. And that same calculation gets played out at every level of every transaction in every corner of the global marketplace. Yet nobody would think of themselves as being a villain for doing it. Or be accused of gouging.
The house sale is a perfect example, and is something to meditate on. (One solution is 'competition' such as making sure new houses are being built, other companies can produce food, etc.)
When a store runs out of flour, people don't get as mad at the store as if they raised the prices but keeps flour on the shelf. Despite the fact that having an expensive option for flour always leaves you better off than having no option.
After Hurricane Katrina there were some prominent examples of people being arrested under anti-scalping laws for trying to haul in food and generators from other areas to sell.