I mean, here we're saying "good" and "bad" without really defining terms. If "good" means acting socially responsibly then corporations are a great example of what I'm talking about. The shareholder-director framework is a system that allows very little room for socially responsible behaviour. Shareholders are human beings, with normal human values, but legally, the director must solely represent their financial interests or risk getting sued. For a CEO to act in a socially responsible way, they should believe that acting otherwise will reduce their profit (e.g. through damage to public image). Based on various scandals in the past, many people characterise CEOs as being sociopaths. The more interesting point is that the job itself is essentially sociopathic.
So, while I think the discussion about how a good person should act in a bad system is interesting, I'm much more interested in figuring out how to create systems which incentivise good behaviour in the long term. For example, why couldn't we have a corporate charter which explicitly valued long term growth or customer satisfaction or public image or job creation. That is, instead of just having a director with a goal that is "maximise PROFIT", have their goals be a more complex optimisation e.g. "maximise XPROFIT + YNUMBER_OF_EMPLOYEES_WITH_DECENT_LIVING_WAGE - Z*CARBON_FOOTPRINT". Wouldn't it be cool to invest in or work for a company that explicitly shared some of your own personal values?