The individual feels the nothingness of human desires and aims and the sublimity and marvellous order which reveal themselves both in nature and in the world of thought. He looks upon individual existence as a sort of prison and wants to experience the universe as a single significant whole. The beginnings of cosmic religious feeling already appear in earlier stages of development—e.g., in many of the Psalms of David and in some of the Prophets. Buddhism, as we have learnt from the wonderful writings of Schopenhauer especially, contains a much stronger element of it.
The religious geniuses of all ages have been distinguished by this kind of religious feeling, which knows no dogma and no God conceived in man's image; so that there can be no Church whose central teachings are based on it. Hence it is precisely among the heretics of every age that we find men who were filled with the highest kind of religious feeling and were in many cases regarded by their contemporaries as Atheists, sometimes also as saints. Looked at in this light, men like Democritus, Francis of Assisi, and Spinoza are closely akin to one another.
How can cosmic religious feeling be communicated from one person to another, if it can give rise to no definite notion of a God and no theology? In my view, it is the most important function of art and science to awaken this feeling and keep it alive in those who are capable of it...A man's ethical behaviour should be based effectually on sympathy, education, and social ties; no religious basis is necessary. Man would indeed be in a poor way if he had to be restrained by fear and punishment and hope of reward after death.
But the scientist is possessed by the sense of universal causation. The future, to him, is every whit as necessary and determined as the past. There is nothing divine about morality, it is a purely human affair. His religious feeling takes the form of a rapturous amazement at the harmony of natural law, which reveals an intelligence of such superiority that, compared with it, all the systematic thinking and acting of human beings is an utterly insignificant reflection. This feeling is the guiding principle of his life and work, in so far as he succeeds in keeping himself from the shackles of selfish desire. It is beyond question closely akin to that which has possessed the religious geniuses of all ages.
Chapter: The Religiousness of Science
Title: The World As I See It
Author: Albert Einstein
Complete text here.