The results of many observational and experimental studies reveal an economically and socially important paradox: people sometimes behave morally in certain situations but then behave immorally (or, at least, less morally) under conditions that differ for reasons that seem morally irrelevant. These patterns are inconsistent with both theories of rational self-interest as well as with theories that incorporate stable moral preferences. This paper presents a theory that reconciles many of these phenomena, including the depressing effects on moral behavior of experimentally introducing uncertainty, social distance, and options to delegate, to exit, to remain ignorant, and to take from or destroy the earnings of others. The theory introduces the concepts of moral salience and virtue preferences, which together with a model combining fairness and altruism explain not only the paradoxes but also a wide range of classic findings on distributive preferences and reciprocity. The results of an experiment that tests the theory out-of-sample proves consistent with the theoretical predictions.