When pondering good and evil, and how they are handled in fantasy, the issues crosses both literature and games, but perhaps the most egregious is D&D alignment.
Originally the law/neutral/chaos axis was just alignment. If a character was lawful and so were you, you were on the same side (more or less). A chaotic character was your enemy. No different from a Ruritanian-Graustarkian war and their allies and the neutral countries, except that Law tended to be nicer, and Chaos worse.
This did not give any indicators to role-playing, and from it came the alignment as philosophy.
That consists of taking every moral and ethical problem that the best and wisest have broken their hearts over, for millennia, misunderstanding half of them, boiling them down to a rules set, set them up to order the entire universe, and handling them over to gamers, many of whom are sophomoric. (Some of the players are even sophomores, which I suppose is some justification.)
Now, the alignment system is wrong-headed in a way that can be infinitely productive of philosophical discussion, but wrong-headed it is. Given that it lumps together honesty and kindness -- and doesn't discuss the virtue of courage, for the obvious reason that in a game filled with battles, were the evil creatures all cowards the game would be over -- and entirely omits wisdom, which is treated as something equal likely to be present for good people and evil ones, and chiefly affects your perception rolls.
Collapsing all the virtues as the same thing gets positively silly.
As for Lawful/Chaotic -- it doesn't help that I played first edition, where paladins had to be lawful because they thought the world was an orderly place, and thieves could not be lawful because there were laws against theft (and what would be a more logical thing to do with skills having no lawful use except adventuring if you were lawful? hmmm?), and monks had to be lawful because they required personal discipline.
As if a thief could not be personally disciplined, and obedient to the law (hence adventuring), and regard the universe as a chaotic mess that his views are a bulwark against.
Even the revision, that lawful vs chaotic is solely your views on society -- which society? If you join with other pirates under strict articles, maroon those who violate them, and would die rather than break faith with your fellow pirates -- while butchering anyone who resists your attacks even after they surrender -- are you lawful?
But the issues go deeper. I have seen people argue that one heinous act in D&D should not make you Evil, when it takes enormous labor of Goodness to reform. After all, Good and Evil are equal and opposed cosmic forces.
That just goes to show that Good and Evil do not work as equal and opposed cosmic forces, and so do not work in the D&D universe. Witness the occasional attempts to make a class of evil paladins, and how they fall apart. And why the player who insists his character has to do evil things because he's evil is such a joke. Evil characters do not do things for evil's sake, but for their own pride, sloth, greed, envy, wrath, gluttony, and lust.
Not to mention that trying to judge characters and actions on such a cosmic scale is a formula for getting players and DMs to argue. Because anyone who does not quail at the thought of adjudicating Good and Evil as cosmic forces down to the most complex of cases is going to have a lot of problems adjudicating without his players getting justly angry.
The wisest rule I have heard came from a DM who did indeed have things like magical swords that had to be used by the Good.
The Goodness would be judged according to the lights of the character who put that restriction on it. This wizard rewards respect for learning and protecting those in authority over the warrior; that one, protecting children and farmers; that one, courage and refusal to allow warriors to be denigrated by the cowardly.
Thus prudently shoving the metaphysics back off the stage, thus allowing characters to argue without being fools. A wise move. Writers of fantasy should emulate it.
Honestly, replacing absolute metaphysics with “what some wizard thought was good at the time” feels like the kind of practical theology we need more of... in fantasy and real life.
My theory for the different opinions on the alignment system:
If you were first exposed to it as a sophomore, you like it. If you were exposed later, you see its flaws.