PROTIP: Press 'i' to view the image gallery, 'v' to view the video gallery, or 'r' to view a random entry.
The concept of character alignment as it is typically viewed comes from the game Dungeons and Dragons, wherein players were able to create their very own characters, customizing a variety of different aspects. One of these aspects is the alignment of the character, which basically indicated whether your character was good or evil and whether he followed the law or not.
The system operated on two axis, one consisting of “Lawful”, “Neutral”, and “Chaotic”, and the other of “Good”, “Neutral”, and “Evil”; you would combine one of the traits of the first axis with one of the traits of the other, thus resulting in alignments such as “Lawful Good” or “Chaotic Evil”, with nine possible alignments in total.
Alignment as a Meme
This all becomes a meme with the practice of taking pictures of characters (or concepts, or a variety of other things) and (usually in the form of a demotivational poster) labeling them as one of the nine alignments. This is then expanded upon by editing together such images (usually following a theme) into a chart, thus giving a representation of all possible nine alignments. Images dealing with just one of the alignments, or just with the subject of alignment itself, also exist.
As for the actual origins of this practice, things aren’t very clear, but many demotivationals exist. Such comparisons have been made since the first release of Dungeons and Dragons, though it’s possible that the book Complete Scoundrel, published in 2007, may have popularized the concept.