They were a product of their time I guess. Religion was a pretty big deal back then, and awful stuff happened to you if branded a heretic. However, the god some of them believed in wasn't the typical bearded man floating on a cloud. The contenental rationalists like Descartes, Spinoza, and Leibniz, believed in a god that was all encompasing, e.g. Spinoza's god was just everything.
Eitherway, just like then, there's still a lot of questions that science has no answer for, so god was usually cast in role to fill that position, which is what Newton did in explaining the stability of planetary orbits. This was later made redundant by Laplace. The modern version is what caused the big bang? Leibniz would say god did, the event of original creation by the supermonad.
Also, go and eat something nice.