Character alignment existed, in some form before Dungeons and Dragons. D&D popularized the concept. A character alignment can be considered the life philosophy for one’s character in role-playing. D&D alignments have evolved over time but the most popular is a Law-Chaos axis crossed with a Good-Evil axis forming a 3×3 grid. There are game systems that don’t use character alignment. Both are fine. In some versions of D&D, deities have alignments that preclude players of certain different alignments from being their clerics.
Some will say that this is overly constrained and inaccurate or have issues with the terms. They’re right. There are 5×5 alignment charts that use alignments such as Moral or Social in addition to the old 9, or Lawful (Neutral) Good, or a 1-5 number system. In any case, I’m more interest in alignment as a life philosophy for characters in books or television and in real life than its role in role-playing. Alignment charts for said characters is a common meme online. See http://knowyourmeme.com/memes/alignment-charts. Due to this messy system, people often disagree about the alignment of fictional characters.
Lawful, Chaotic, Good and Evil are loaded, inaccurate, and broad terms.
Instead, I use Ordered, Free, Altruistic, and Egocentric.
Ordered: Prioritize order over freedom.
Neutral: Order and freedom are equally important.
Free: Prioritize freedom over order.
Altruistic: Prioritize other over self.
Neutral: Other and self are equally important.
Egocentric: Prioritize self over other.
Ordered Altruistic (OA)
Ordered Neutral (ON)
Ordered Egocentric (OE)
Neutral Altruistic (NA)
True Neutral (TN)
Neutral Egocentric (NE)
Free Altruistic (FA)
Free Neutral (FN)
Free Egocentric (FE)
These alignments apply to humans but non-human animals, deities, and non-human sapient beings (aliens and synthetic intelligences) are True Neutral. My understanding is that the majority of people are True Neutral and a majority of the rest are True Neutral leaning towards one or two other alignments.
Governments and societies also have alignments.
Governments (or lack thereof)
OA: Nanny state
ON: Rechtsstaat (Rule according to higher law)
NA: State consequentialism
TN: Night-watchman state
Here’s a chart for a few of the characters on Archer (FX/FXX)