The problem with any intellectual theory of "morality" is that it overlooks two important facts. The first is that evolution has hardwired into us certain generic responses that, on average, worked well enough most of the time in our ancestral environment - an environment radically different from the one we've accidentally created around us today. The second is that almost no one ever thinks about morality at all, not least because nearly all "moral codes" are internally inconsistent. People just do what purported authority figures tell them is "the right thing" and they simply don't think about anything, ever. Moreover, as the trolley car thought experiment clearly shows no "moral code" can be adequate as a one-size-fits-all, it's evident that people are emotionally driven to embrace particular stances (because emotions are how evolution has inculcated within us the triggers for pre-set patterns of behavior) and not at all driven by any semblance of coherent thought.