Because everyone wants to be more than mortal. They do not like to feel helpless, or powerless in the face of that. This is why we have science and religion, we are consciously aware of our own mortality, our weaknesses.
Dimitri Mendeleev dreamt the periodic table.
Russel Wallace had a fever and dreamt about the theory of evolution. He was different to Darwin though, even though Darwin often quoted him. Wallace believed in a non material origin of higher mental faculties, he said that mathematics, artistic, musical, metaphysical, wit and humour set humans apart. He believed an unseen universal spirit had intervened 3 times, once in creation, once in the introduction of consciousness in higher species and once more in the mental faculties of humankind. Wallace also thought of a pure paper money system not backed by silver or gold.
August Kekule dreamt of Benzene molecules. He dreamt of dancing atoms, a snake swallowing its own tail, ie rings of carbon.
Srinivasa Ramanujan dreamt that a hindu goddess drew mathematical proofs for him. These turned out to be accurate.
Otto Loewi dreamt that it was chemical messengers that signal across synapses. This won him the Nobel Prize.
Louis Agassiz understood the structure of fossil fish by dreaming.
Rene Descartes dreamt of the basic scientific method. He was in the kitchen with his masonry heater when he had 3 visions from a divine spirit. Upon exiting these visions he formulated analytical geometry, which he believed the pursuit of science would be the pursuit of all wisdom. Descarte also believed in an evil demon, deus deceptor.
Hermeticism was popular amongst the Reinnassance scientists, Issac Newton was one "the resource or art of divine work." This descended from Egypt.
Most of the great scientists believed in something. For many it was their dreams that brought answers, they classed this as a knowledge, something that many of todays minds dismiss as "having no meaning."