Whereas existing OLG models with endogenous longevity neglect the impact of environmental quality on mortality, this paper studies the design of the optimal public intervention in a two-period OLG model where longevity is influenced positively by health expenditures, but negatively by pollution due to production. It is shown that if individuals, when choosing how much to spend on health, do not internalize the impact of their decision on environmental quality (i.e. the space available for each person), the decentralization of the social optimum requires a tax not only on capital income, but also, on health expenditures. The sensitivity of the optimal second-best public intervention is also explored numerically.