This paper mixes state-dependent utility theory with endogenous preferences to investigate the optimality of unemployment insurance. In our model, individuals assign weights to consumption units in two possible states: work or unemployment. The higher the weight assigned to consumption in the work state, the lower the one assigned to consumption in the unemployment state. These weights shape the magnitude of moral hazard effects while searching for jobs as well as the desire for unemployment insurance. The model can predict that the demand for social insurance remains low despite unemployment exposure is large. In a sufficient statistics approach à la Chetty, we find a new sufficient statistics formula which takes into account inherited values. We show that unemployment insurance is higher than the optimal level in a lot of countries, except for the UK, due to high preferences for work. In a second part of the paper we extend the model to explain the difference in take-up rates of unemployment insurance for different social backgrounds.