Omnius of Alephgaming talked about alignment. I have a bit something to say about it, too.
First, assumptions: Alignment has something to do with character behaviour. It may be descriptive or prescriptive, but some sort of connection must exist. Further, alignment does not have concrete and significant mechanical effects for most characters. If it does, at least I count it as a personality mechanic, no longer alignment, which means it gets a bit more tangled. Even further, alignment does not have an exact definition, because otherwise people would argue about it anyway due to conflicting ethics and such.
So. What purpose does alignment have? First, it can be used as a roleplaying guide. This is especially useful to new players, casual gamers, or people just not that interested in developing a compelling personality for their character, but who don’t want to play themselves. When in doubt about what the character would do, check the alignment and act according to that. Otherwise ignore it. I feel that this is a very useful function of alignment. It can be accomplished by personality rules or just writing down some phrases like “honest” or “sadistic”. But alignments are one way of accomplishing the goal.
Second, a bit more controversial, effect that alignments can have is a clear division into good guys and bad guys. Like, as a totally hypothetical example which is not in any way related to D&D, it may be that all bad guys are always evil and all player characters more-or-less good, and good defeats evil. This is very useful for high-action games with little interest in deeper issues. The enemy is evil, so slay them. One can create compelling moral dilemmas in a clear-cut world, of course, they just will look a bit different. It may be that anger leads to evil (or the dark side). Will your good guy get revenge, no matter the cost, even if the good status may be lost in the process?
One can, naturally, ignore the sides implied by alignments. Good people are those who tend to be kind and helpful and hug puppies, while evil ones are hurtful and want to hurt people and kick puppies, but this does not meant that good characters will always get along, due to such factors as personality, goals, scarce resources, whatever. The question I pose to people playing like this is: Why not get rid of alignment altogether and replace it with descriptive personality qualifiers? They do all the job that stunted alignments do and don’t imply an undesired division.