Beliefs affect behavior. Anything we believe strongly can change behavior. Beliefs are the source of the placebo effect. People want, even need, to believe in something beyond themselves and the visible world to give meaning to life and hope for something after this life. Prayer is not answered by God, but by those who pray.
Religion is the source of many good things - art, music, literature.
But it is also the source of much that is bad - wars, persecution, prejudice, discrimination and denial of freedom and rights. While there is no convincing evidence for the existence of God, belief in God can be a positive influence in a person's life. There is no God, yet belief in God is a powerful influence on behavior - for good or bad. Spirituality is not necessarily religiosity. The spiritual is not a separate realm.