Alignment is a core part of the DnD ethos, giving rise to a host of associated memes. It is so deeply integrated into the popular conception of DnD that the terms “lawful good” and “paladin” are often used as synonyms. It is thus unfortunate that the entire concept of alignment is stupid down to it’s very core.
There exists an interesting attempt to rationalize Golarion, including primordial alignment forces, you can take a look: https://recordcrash.substack.com/p/mad-investor-chaos-woman-asmodeus
A good overview of the alignment problem and nice proposed solutions