D&D does actually deal with remarkably clear lines between Good and Evil. Demons, devils and undead are all clearly in the evil category, as are most of the monsters you need to kill.
Of course you can play it with a lot more moral ambiguity than that, but out of the box, D&D is very suitable for a black & white world view.