Americans are happier in states where governments spend more on public goods, among them libraries, parks, highways, natural resources and police protection, a new study has found.