What explains the range of situations in which individuals cooperate? This paper studies a model where individuals respond to incentives but are also influenced by norms of good conduct inherited from earlier generations. Parents rationally choose what values to transmit to their offspring, and this choice is influenced by the spatial patterns of external enforcement and of likely future transactions. The equilibrium displays strategic complementarities between values and current behavior, which reinforce the effects of changes in the external environment. Values evolve gradually over time, and if the quality of legal enforcement is chosen under majority rule, there is path dependence: adverse initial conditions may lead to a unique equilibrium where legal enforcement remains weak and individual values discourage cooperation.