Since some people here gets touchy about trying discus real world moral. Let me give you much more themed example. Not even just D&D-themed, but specifically Forgotten Realms. Or specifically FR cosmology, earlier known as Great Tree (now it doesn't have any name, but that's mostly because 5th edition cosmology lore mainly is a huge mess).
Most of you probably heard of Lathander. Most consider him as THE most good-aligned deity.
What many of you might not know, is that at some point (very far in the past) Lathander rebelled against established nature of cosmology, and attempted to reform it entirely, putting himself on the very top (so practically he attempted to unseat Ao himself). The event was known as Dawn Cataclysm.
Reason of it mostly was that he couldn't stand of nature of good vs evil balance. And wanted re-establich cosmology only with forces of Good dictates how things are, and all evil being relentlessy hunted down.
His attempts ultimately failed, causing of death of several gods in the process. Helm specifically could never forgive Lathander for death of his lover.
So... good intentions, that ultimately lead to horrible disaster. And by all accounts Lathander still is good-alligned god.
Sort of. Sadly WotC decided to ditch the whole dawn cataclysm story when it decided to blow up the realms for 4e. Grrrrr.
But in my reading of the where the story was going: the dawn cataclysm caused him to change his very nature. Remember that at the start of 4e Lathander is dead. Or as Amaunator's faithful like to think of it - he matured into his noon time state.
As I read this Lathander's act changed his nature fundamentally - the attempted reordering of the world was a Lawful act. All of you will follow these rules. Proceeding knowing you were going to kill innocents for the greater good was morally grey act and shifted his alignment away from good. That's why Lathander isn't around in 4e - he became the Lawful Neutral god Amaunator.
Lathander only came back because fans demanded him back and WotC have never fully explained his return. Now, as the god of rebirth, his return makes a great of sense but the sun cycle has changed. It was supposed to be Dawn Aspect becomes Noontide Aspect becomes Dusklord but - because people liked Lathander - morning followed noon in 5e.
@ledra2
I don't think you can use moral foundations theory to explain actions in the realms. And, frankly, I think that theory is a bunch of horse manure and it's author a cheap charlatan. For all the problems of the 9 box gird it does a better than MF theory!
Trying to get any real world moral theory to work with the alignment grid is destined to fail - but there was a very interesting Dragon magazine article about this decades ago - but you were bound and determined to do it I would start Plato or Kant. There is a form of Law, a form of Good . . .