I think that
moral foundations theory would be a good place to start if you want to formalize this. The six foundations (Care/Harm, Fairness/Cheating, Loyalty/Betrayal, Authority/Subversion, Sanctity/Degradation, and Liberty/Oppression) could work very well to represent, in a way that's nuanced enough to be useful for roleplay and characterizations yet simple enough for a game system, both which principles a character considers important and how they measure up in light of those principles.