Richard Bartle's Designing Virtual Worlds noted that alignment is a way to categorize players' characters, along with gender, race, character class, and sometimes nationality.
Characters acting as a party should have compatible alignments.