I would say that the point of alignment is to allow for moral effects with a relatively simple mechanic. Some priests can cast spells that protect against evil people but are useless against the forces of good or those whose actions haven't tainted them very much. How do you know if the spell works on oppenent number 5? Well, you could have a complex system of karma points (which as any player of Ultima knows is open to a fair amount of gaming--no matter how complex you make it, a karma system always allows your character to get away with murder as long as you give enough gold to the beggars). Or, maybe you will have a system of taint like unearthed arcana. But having an alignment is a pretty simple way to resolve the question quickly. Being good, evil, or neutral also has the advantage that it is a judgment that corresponds to our real-world concepts and can thus be quickly eyeballed. What kind of a karma score should opponent number 5 have? That raises a lot of questions and any quick answer is bound to be arbitrary and imprecise (which is a weakness in a system where precision is important). Is he, good, evil, or neutral. You can make a snap judgement on that.
That's the use of alignment. It allows for the relatively simple use of morality based magic like holy smite, holy swords, unholy blight, and unhallow.
The simplicity and lack of specificity in the alignment system also mean that it is not necessarily open to gaming in the same way that a codified karma system would be and isn't tied to a specific cosmology the way the UA taint is. You can (and D&D writers historically have) bring more than one ethical system for the back end (determining who qualifies as good, evil, or neutral) without changing the mechanics of the game to accomodate it.