Objective alignments.
This appears, in large part, to mainly address "railroading" as alignment decisions.
The problem is that in D&D alignments ARE. (I'm not the first to bring this up.)
Falling and gravity aren't (except in very strange circumstances, perhaps) matters of theme and evaluation. Good, evil, freedom, duty, honour, expedience, etc are. That's the difference.
Good and Evil ARE.
If you want to be something other than good or evil, you CAN! That's what neutral is for.
But from the moment I create a character and write "chaotic good" on his character sheet, he IS good. If I then, from the moment of first playing, start worshipping devils, killing babies, etc, etc, I'm going to switch to evil. From that first moment, I detected as good. I would be immune to damage from holy word, but blasphemy would affect me. And over time, those words on my character sheet would change. Ideally, it would be my responsibility to change the game rule "keyword" on my sheet to neutral and then to evil on my own, when I, as a player believe I've done sufficient evil to counteract my good actions, and I believe that my outlook/philosophy has become one that compromises my goodness.
But what if I didn't? What if I somehow decided that in my view of the world devils were the "good guys" because they "rebeled" from the tyrranical strictures of the gods? I decide that I'm going to keep the keywords "chaotic good". Sure I'm doing things for lawful evil beings, things that they endorse and aprove of, but I don't beleive them to be lawful evil...they're rebels, and they're good because they sought their own freedom!
A good dm and group that don't mind exploring players doing evil things (rather than a "no evil pc's rule" that many groups have because they've agreed to play a heroic game and not a backstabbing game) will allow this player to do every one of these things. Every one, except for not changing that rule "keyword". Because, the player IS now evil. They can believe that they are not, roleplay as such, etc. But they are. There IS an objective answer. They are now vulnerable to holy word and immune to blasphemy. They detect as evil. I can't fathom a group that would go along with them being Chaotic Good, though I can fathom a group whose characters might also be under the same delusions as the CG/LE character I'm describing.
Worshipping devils is evil. Period. That is part of the rules, not a railroad, not a dm decision, it is as linear as "you drop something, it falls".
But then there are greys. Lots of greys. That is where things can get interesting and this exploration can occur. Just how much devil worship is required to become evil? Is worshiping a devil that you don't know is a devil evil? What if it is only the lawful tenets that you hear for the first year? Not evil then, (but lawful). What if you only call upon the devil once in a time of great need, and then seek to atone (the spell atonement is useful here, but again, it depends on the deed if it's even needed)?
What if, for the slavery example, is a world in which "slavery is evil". (It IS by the way, for D&D RAW). I can play a character who is neutral, really loves his slaves like brothers, treats them kindly, and believes himself to be good, particularly if I do other good things to counteract this evil I am doing, and I am doing as much as I can to mitigate). Heck, I might even be able to push my official alignment to good if I own only one slave, he's more like a hireling, we do lots of good actions together, and that's the only evil thing I do. Because, there is the objective fact "slavery is evil" and then there is the rest of the actions of the character. No evil character exists that never, ever, ever does a good thing. No good character exists that never, ever, ever does an evil thing.
There is still room for exploration, there is still room for dm consequences, both in the world (arresting characters for killing babies) and in the rules (you've killed every elven child below the age of 10, amounting to attempted genocide...guess you're not "chaotic good" on your sheet anymore).
And then we get to "houserules". Necromancy not being evil (or devils, or slavery) would be a houserule. (Actually necromancy is more debatable, as there are some spells that are not evil and some that are, such as animate dead...but animate dead not being evil would be a houserule). Houserules are generally created by a dm and then accepted by the group (whether they like them or not, there is a tacit acceptance by playing at that DM's table...they agree to play by the rules of the table). Now their characters don't have to believe the truths of the world, but the truths are truths. They are in the same way that my character doesn't have to believe he missed when the numbers don't add up to AC, but I did, in fact, miss and will do no damage. (I could even see roleplaying this event, especially with a bow).
That is not to say there can't be some pretty stupid houserules. I would not play with a dm who stated that devils were actually good, unless the actual nature/behavior of devils was far different from the usual expectations. If it were simply a rule change (like changing their alignment on their entry) but they did everything else the same, it would be as bad as my CG/LE player character mentioned earlier. It would be a world in which the game didn't make sense to me. If the dm were to rule that devils were thought of as good, then that's an entirely other manner.
But changing animate dead to being a neutral act is a matter of refluffing it. Instead of desecrating remains, the gods view remains as just a shell, animating it is no different than animate objects. It's just somewhat easier because it was an object that was previously animate on its own. Conversely, creating golems is not evil, but a dm could refluff that as well. Instead of magical animation, it is the process of stealing someone's soul and binding it to slavery in clay (or stone or iron, etc) form.
The overall point is that the DM does need to determine what is a good act and what is an evil act as a truth. A DM that does not do this HAS HOUSERULED THAT THEY ARE NOT USING OBJECTIVE ALIGNMENTS IN THE GAME whether he is aware that he's housruled it or not. It's part of the system. What the character believes, how they act, etc. is not up to the DM. I'm not saying it's WRONG for a dm to houserule that they are not using objective alignments, but as part of RAW they exist. If someone doesn't like that in their game, they certainly SHOULD houserule them away.
Wow, that was long. If you're still reading, you're a trooper!