You may want to look at the long history of severe abuse perpetrated by the Church in their pursuit to "combat this".
We've just seen the Irish Laundry report released and it's fucking horrific.
https://www.history.com/news/magdalene-laundry-ireland-asylu...
https://www.irishtimes.com/news/social-affairs/women-on-seco...
https://www.irishtimes.com/news/social-affairs/treatment-of-...
Looking at the past with rose colored glasses is dangerous.
It can and should be improved, but that does not mean we have to pretend that part was all that better.
It's like being overweight. Everyone knows what they should do. Most people can't do it, however, and there isn't much social support for it. In Asian culture, we have all of this social reinforcement about our weight and eating habits. (Though south asians differ quite dramatically from east asians with respect to what they consider fat.) In the U.S., you're left to fend for yourself. Some people go to the gym regularly and eat healthy despite all of the cultural forces working against those good decisions. But most people don't. They just get fat.
Genuinely asking, because it never struck me that the foster care system was ever not horrible in America.
There isn't a good answer to the problem of kids when the parents don't care for them.
It was horrible match and there was huge amount of abuse going on.
Or some of these customs, traditions and institutions evolved to combat it through unconscious group selection. The tribes/towns/cities/countries/groups that had superior civic norms (superior defined as those norms which promote harmony, prosperity, in-group cooperation, etc) tended to attract immigrants, be capable of dominating geo-politically, etc, and thus those cultural values become dominant through this process of selection.
Also, while I think that explains things to a certain extent, it's just part of the picture. Culture also come from (i) self-interest, (ii) power asymmetries, and (iii) an unintended by-product of our evolutionary psychology/emotions/personalty traits such as jealousy/disgust sensitivity among others. For example jealousy mediating a desire for taxation (this has been studied by psychologists, it is one of the three common motives), or disgust sensitivity mediating a desire for borders and authoritarian leaders.
Add to the fact, often the most impoverished countries tend to be more religious. You're not finding a strong correlation to your point.
Poverty and education is a foremost problem.
Which way does that correlation run? Maybe impoverished countries are especially in need of the social organization provided by religion because, unlike rich countries, they can't afford to "f--k around?" They can't just spend government funds to deal with the negative social consequences of out-of-wedlock births, divorces, etc.
Now we're running around tearing down Chesterton's fence every time we see it, without bothering to ask why it was erected in the first place.
As an atheist, it's becoming increasingly evident that atheism has done great damage to society at large. We're foolish to think that social technology that has worked for thousands of years was only built (and replicated independently across hundreds of disparate societies) because we were too stupid/evil/backward to see real enlightenment.