Homes allow your Villagers to socialize and to sleep. Both these behaviors allow your Villagers to regain Happiness.