There are two reasons for this:
The first reason is evolutionary. The original concept of gods, or rather of spirits, invisible beings created in mankind’s own likeness, arose at the time of the cognitive revolution some 75,000 years ago. This is when humans first developed a meaningful language and were first able to converse with others about the world. Concurrent with this, these ancient ancestors of ours – still at a time before they left Africa to spread around the world – would have wondered what drove nature; why did the sun seem to rise and set, what caused the changes in the seasons, why was there thunder and lightning, why did plants grow, what caused the tides to ebb and flow.
These early people had absolutely no concept of the real reasons for such things, and the only thing they could imagine was that there were invisible beings who made them happen – a primitive form of cause and effect; someone or something does this, and that happens. This was the start of a belief system called animism, still seen to this day in primitive tribes in remote parts of the world where the people have never made contact with modern society. To these ancient ancestors of ours, this was an entirely satisfactory means of explaining the inexplicable, and it sufficed to explain the natural world and all that happened in it for many tens of thousands of years.
But during this time, this belief in invisible spirits who controlled nature became embedded into our genes, predisposing thousands of generations of humans who were spreading around the world, to believe in the supernatural. Hard evidence for this is starting to appear with some of the latest advances in both genetics and neuroscience. For instance, it appears that the vesicular monoamine transporter 2 (VMAT2) gene predisposes humans towards believing in spiritual or supernatural experiences, and there are certain specific parts of the brain, so-called ‘god spots’, which become active when people who are religious, talk or think about religion.
The second reason is organization. If we again wind the clock back, this time to some 10/12,000 years ago when humans first started to move from their roaming hunter-gatherer life to a more settled life at the time of the agricultural revolution, for the first time in history mankind people needed to co-exist and cooperate with others who were outside their immediate family group. Some form of mechanism for establishing law and order, no matter how rudimentary, and for protecting things like property rights, needed to be established.
Remember this was at a time when the belief systems of people were still very primitive, and about the only common factor, there was, was this belief in invisible spirits who controlled nature, and whom it was thought could punish humans (by way of illness, disease, harsh winters, poor harvests etc) if they were being ignored or not actively paid homage to. Someone, somewhere, realized that this fear of retribution could be used to control the behavior of people, and over time, and probably in the region of what’s now south-east Turkey or north Iraq, it began to be used to control the behavior of people in what was the first form of government.
We don’t know exactly how long it took for this primitive form of control to develop its own hierarchy of people, people who saw the personal advantages of being the leaders of the groups who ‘spoke’ for the spirits and interpreted what they believed they wanted of people and thus benefited from the status it afforded them. But by the time writing first developed we know there were well-established structures in place, all based on using the fear of the ancient spirits, now starting to be called gods, to control the behavior of people.
These people, the early priests, enjoyed very considerable benefits, as witnessed by many documents and other writings going back several thousand years, and the first formalized organized religions had been born. This situation lasted for several thousand more years, and as populations grew, so did the size and power of the priesthood. Ancient Egypt is a very good example of this, with the power of the priests, and their lifestyle, being second only to that of the Pharaoh and his/her family.
With this population growth and with the increasing knowledge of people, different means of controlling them had to be found. Again whilst we don’t know exactly where and when, we have many references to the belief that if you’d cooperated with the gods during your life, you’d be rewarded in eternity after you’d died – the early concept of heaven – and ritualized behavior had started to be introduced in order to reinforce this belief in people.
This situation continued over thousands of years and developed independently around the world – strong evidence the origins of the god concept was from a time before the great human migration out of Africa – whenever cultures started to reach a certain level of development. The religious hierarchies of the world, each believing in their own gods and children of gods, all allegedly performing their own miracles and making their own promises to their faithful followers, were very firmly established, and right up to a few centuries ago were about the only controlling influences in the countries of the world. Organized religion was the most powerful force on the globe, believed by almost everyone.
Today of course science and logical reasoning prevails, and we know the real reasons why nature is as it is. However, organizations that have lasted for millennia on the basis of superstition and invisible gods aren’t going to give up the power, control, influence, and wealth they’ve been used to, easily. Aided and abetted by historic links to government, organized religions are largely free of all the normal legal and moral constraints which apply to virtually every other organization and business, and are free to continue to spread their archaic and demonstrably man-made stories about gods, heavens, afterlives, angels, demons…, and all the other dogma with which they’ve surrounded themselves.
So thanks largely due to the indoctrination of children too young to be able to discriminate between fact and fiction and the evolutionary predisposition to believe in the supernatural, and reinforced by promises of eternal bliss in mythical heaven if you do as the predominant religions tell you to do, and threats of eternity in a fearful hell if you don’t, belief in gods and their power still exists. It’s a testament to the way in which our human psychology works, all based on the beliefs of our ancient ancestors and the self-sustaining needs of organized religion, without which they would crumble, losing all the power, influence, and wealth they’ve accumulated over the centuries.
Gods are not real, they never have been, and it’s only the power that a forced belief in them brings religious organizations, which keeps that belief alive today. Religion and the belief in gods is nothing more than learned behavior, period.