There is a world of difference between a principle for right conduct and a culturally introduced arbitrary moral stricture. The former is a matter of rationality, the latter a matter of holding agreements made in the group, such as "don't eat fish on Friday" or "don't eat pork" as a rule which has no application outside its cultural base.
How you sort out "right action' depends on what is genuinely going to bring about the most good for the most parts of any given puzzle.
That is very different from "agreed upon codes" which are moral agreements about how to act, cultural mores. I hope the difference is clear...