That's a diffuse societal benefit. Think much more selfishly. They have no value to _you_. Social welfare programs for the old make sure that my kids have no impact on my retirement. They could be wealthy or not, but I am not dependent on them.
If diffuse societal benefits were good motivatiors, communism wouldn't be such an abject failure at a large scale.