Short version? D&D is a grab-bag of random pop culture concepts its creators thought seemed cool over several decades. Which is fine. It doesn't all fit together, it often clashes catastrophically and collapses if you poke it with a stick, but that could be a feature rather than a bug... except D&D is a franchise also invested in its own authority, which means it keeps trying to pretend that all these disparate elements are somehow part of a coherent plan.
And attempts to weld the pieces together so they don't fall apart... just reveals more problems.
So, necromancy in D&D is a collection of very Christian European concepts, drawing on folk/Indigenous traditions, Protestant doctrine, Catholic syncretism, and anti-Jewish propaganda... but also they're all filtered to the game through American creators consuming British and American pop culture representations of the concepts--like Hammer Horror films and Kolchak: The Night Stalker.
And then it's mashed up against a pop culture understanding of pantheism (gods that act as competing Christian-style monotheisms rather than elements of a coherent faith), and a pop culture mishmash of various cultures' and traditions' ideas about the nature of the spirit and death.
Which, again, I love to see settings that contain many truths simultaneously, they're real and vibrant and dramatic.
But as a franchise, D&D isn't comfortable with that kind of ambiguity, so it makes Declarations Of Truth about How Things Are, even though those statements are literally impossible to sustain in the face of its own origin as a syncretic mashup of cool pop culture references.
And that winds up meaning that it's not just a franchise that is uncomfortable with self-examination, that discomfort extends outward into discomfort with audience and creators who don't fit its mold--even setting aside the awful business practices of its parent company.
So, animating the dead is Not Good because... everybody knows necromancy is evil, right? But we aren't going to talk about WHY it's evil because we can't: the blanket declaration that only evil people are comfortable to animate the dead implies a universal truth about the nature of the soul and the body, but the franchise can't sustain that line of thought without ripping apart other parts of its world.
Alignment itself is, of course, a prime example of this. It derived from a novel where law and chaos were sides one took in a universal war where one's everyday actions aided or hindered the battle.
But it glomped onto other notions like the idea of a Christian priest using a holy symbol to rebuff evil beings, which they got from Hammer Horror films. And over time the alignments stopped being meta-political allegiances and started being elemental forces in their own right, manifesting literal planes of Good and Evil alongside planes of Fire and Water and Metal and so forth.