Governments often increase productivity. Try investing in a country with no laws, education, or infrastructure. They can also help make an economy more efficient by maximizing positive externalities and minimizing negative ones. Social benefits can also be beneficial economically as an externality. Companies don't have the incentive to keep someone from starving or to educate them from kindergarten, but having a larger, more educated work force certainly benefits the economy as a whole.