Observing immoral behavior increases one's dishonesty by social influence and learning processes. The neurocomputational mechanisms underlying such moral contagion remain unclear. We tested different mechanistic hypotheses to account for moral contagion. We used model-based fMRI and a new cheating game in which participants were sequentially placed in honest and dishonest social norm contexts. Participants' cheating behavior increased in the dishonest norm context but was unchanged in the honest. The best model to account for behavior indicated that participants' valuation was dynamically biased by learning that others had cheated. At the time of choice, the internalization of social norms was implemented in the lateral prefrontal cortex and biased valuations of cheating. During learning, simulation of others' cheating behavior was encoded in the posterior superior temporal sulcus. Together, these findings provide a mechanistic understanding of how learning about others' dishonesty biases individuals' valuation of cheating but does not alter one's established preferences.