It's rare for this to happen to me, but I know that when it does happen, it's because of a difference of philosophy between myself and the games' developer. Profiteering might be seen as selfish if it disadvantages others in an economics game, while for objectivists, it would be seen as a fundamentally virtuous action, since they view selfishness as a virtue. (I definitely fall into the former category, which is sort of ethical vanilla by game designer's standards, unlike the objectivists in the example.)
The other way this can happen is when there is a complicated set of circumstances in the context of the action that the developer couldn't program into their game's morality system. Say, if character X is running, with the full intent to kill, into a room full of ten character Ys, and you want to save the most lives, so you kill character X. Character X might just be a good guy in the on/off morality toggle of the game, or in the story, but in the context of the gameplay, he needs to be stopped. Developers miss this sort of stuff all the time, especially if they don't test a game extensively enough before release, and allow team killing.
Yureina said:
Killing Moriarty in Fallout 3. That guy is a bastard, pure and simple. Karma loss for killing him is ridiculous.
Hmm, I wouldn't quite call that unambiguously good as actions go. While he's certainly slimy, and holds a lot of people in a cycle of debt, he doesn't really go around killing people. Only murderer characters like Raiders really get you good karma in that game, suggesting that the only good action is one that ultimately saves more lives than it takes.