It is unfortunate that Einstein, who was brilliant in so many other ways, nonetheless believed in all that religious BS. Even worse, he was far from unique in that regard. (A lot of otherwise intelligent people buy into that garbage.)
Don't be too hard on him. He didn't follow any dogma.
"I believe in Spinoza's God who reveals himself in the orderly harmony of what exists, not in a God who concerns himself with the fates and actions of human beings." - Einstein
"I cannot conceive of a God who rewards and punishes his creatures, or has a will of the kind that we experience in ourselves. Neither can I nor would I want to conceive of an individual that survives his physical death; let feeble souls, from fear or absurd egoism, cherish such thoughts. I am satisfied with the mystery of the eternity of life and with the awareness and a glimpse of the marvelous structure of the existing world, together with the devoted striving to comprehend a portion, be it ever so tiny, of the Reason that manifests itself in nature." - Einstein
"It was, of course, a lie what you read about my religious convictions, a lie which is being systematically repeated. I do not believe in a personal God and I have never denied this but have expressed it clearly. If something is in me which can be called religious then it is the unbounded admiration for the structure of the world so far as our science can reveal it." - Einstein
"Both deism and traditional Judeo-Christian-Islamic theism must also be contrasted with pantheism, the notion attributed to Baruch Spinoza (d. 1677) that the deity is associated with the order of nature or the universe itself. This also crudely summarizes the Hindu view and that of many indigenous religions around the world. When modern scientists such as Einstein and Stephen Hawking mention 'God' in their writings, this is what they seem to mean: that God is Nature." - Victor J Stenger, Has Science Found God? (2001), chapter 3