The simplest answer I can provide is this:
On the axis of ethics, Law implies that a person places society before individual rights. Chaos implies that a person places individual rights before society as a whole.
On the axis of morality, Good implies that a person places others before himself. Evil implies that a person places himself above others.
There are many different definitions for alignment; the above is one of them.
In D&D terms, part of this is due to the fact that the brand changed writers; E.G.G. had his ideas, Mentzer had his ideas, and Cook/Tweet/Williams had theirs (among others).
For Gygax (in the 1e DMG), Good was identified with the
principles of Life, Liberty, and the prospect of Happiness. ("Hey, Gary -- way to crib the U.S. Declaration of Independence.") This naturally led to an identification of Good with Principles -- because, you know,
there the principles are, clearly stated -- but this was largely due (IMHO) to the fact that if you don't defend the rights of others, they are unlikely to defend your rights in return. (That isn't
altruism, it is
thinking ahead.)
For Cook/Tweet/Williams, the identifications of Law=Order and Good=Altruism are pretty close -- but those are vastly different from Gygax's non-altruistic version of Good.
Another Gygaxism is about Evil: he was quoted somewhere as having said that, for him, the clearest expression of Evil was the old W.C. Fields line, "Never give a sucker an even break." (Sorry, I don't have a link to the quote.)
Much along the same line, Gore Vidal is quoted as saying, "It is not enough to succeed, others must fail" -- which I personally think is about as Evil as the Fields quote, because the Vidal quote subsumes the Fields quote: it states that any sucker would have to fail in order for you to succeed.
Personally, I hold that a Good person prefers Win-Win situations ("there does not have to be any loser, here"), while an Evil person prefers Win-Lose situations ("for every winner, there is always a loser"). However, I have no idea how that could be implemented in game terms.
Some other takes on alignment:
WotC, 25 March 2005
Neverwinter
Mandos' editorial revision of Neverwinter
Steelhammer's "Law=Justice, not Rules" revision
CodePoet's "Whose Law" interpretation (with lots of examples)
The "why you did it" simplification:
A variant "why you healed it" simplification:
Scorpio's "GameGrene" Experience
. . . and it gets worse:
Recalculate Daily: