A lot of those people are from a time where god was seen as necessary to explain the natural world.
Einstein did NOT believe in god. In fact, on top of that I believe he called the bible "childish".
And even so, plenty of smart people were also atheists. In fact, they were so out of proportion to the general population. But that doesn't prove anything; all the smart people in the world can believe in something and it can still be wrong (see: flat earth).
Heisenberg, quantum physicist - died 1976
Pasteur, one of the three founders of microbiology - died 1895
Linus Pauling, quantum chemist and molecular biologist, one of only four people ever to win multiple Nobel Prizes - died 1994
Mendel, founder of the modern science of genetics - died 1884
Tolstoy, widely considered one of the two or three greatest writers in the history of mankind - died 1910
Van Gogh - died 1890
Kierkegaard - died 1855
Flannery O'Connor, widely regarded as one of the greatest writers in all of history - died 1964
Martin Luther King Jr. - died 1968
Donald Barthelme, widely regarded as one of the most important American authors of the 20th century - died 1989
John Cheever, Pulitzer-prize winner, widely regarded as one of the most important American authors of the 20th century - died 1982
Andrei Tarkovsky, considered one of the great directors in film history, called the greatest by Ingmar Bergman - died 1986
Ermanno Olmi, considered one of the greatest living film directors, won the 1979 Palm D'Or at Cannes - still alive
So that's thirteen out of the twenty-two I listed that most definitely did not live in a time without science when people needed religion to "explain the natural world."
Direct quotes from Einstein:
"Science without religion is lame, religion without science is blind."
"The devil has put a penalty on all things we enjoy in life. Either we suffer in health or we
suffer in soul or we get fat."
"It is only to the individual that a soul is given."
"Intelligence makes clear to us the interrelationship of means and ends. But mere thinking
cannot give us a sense of the ultimate and fundamental ends. To make clear these fundamental
ends and valuations and to set them fast in the emotional life of the i ndividual, seems to me
precisely the most important function which religion has to form in the social life of man."
"My religion consists of a humble admiration of the illimitable superior spirit who reveals
himself in the slight details we are able to perceive with our frail and feeble mind."
"When the solution is simple, God is answering."
"God does not care about our mathematical difficulties. He integrates empirically."
"I want to know God's thoughts,..... the rest are details.."
Clearly Einstein himself struggled with the question of who God is - never at any point did he dismiss the possibility of God's existence. As to your contention that a disproportionate percentage of smart people are atheists, that's an unsubstantiable generalization.
Proverbs 1:7: The fear of the Lord is the beginning of knowledge: but fools despise wisdom and instruction.