The costs (time, money) of raising children are significantly privatised but the economic benefits once they reach adulthood tend to flow to government and society at large.
In the past, many parents expected to receive direct economic benefits from the labour of their children. Children were expected to e.g. contribute on the farm.
In countries without social safety nets, younger generations are expected to directly support older famility members.
Having kids used to be something with pretty direct economic benefits, it's now expected to be a somewhat more altruistic enterprise.