A god is created my men as the final answer to everything, because we knew almost about nothing back then. God then is developed as a political tool to control people and keep them in line, just to show how vulnerable the leaders are. And nowadays "he" is used as a business for the prophets to earn big bucks.
I'm going to have to take the easy way out and quote my 'namesake':
'Religion is an attempt to get control over the sensory world, in which we are placed, by means of the wish-world, which we have developed inside us as a result of biological and psychological necessities.'
or, in more concrete terms:
'If one wishes to form a true estimate of the full grandeur of religion, one must keep in mind what it undertakes to do for men. It gives them information about the source and origin of the universe, it assures them of protection and final happiness amid the changing vicissitudes of life, and it guides their thoughts and motions by means of precepts which are backed by the whole force of its authority.'
see also my 'atheist pamphlet' at atheistprinciples.tripod.com
or, a parallel way of looking at it -
the functions of ancient religions are easily recognised. pity most people can't get the same minimal quantum of perspective necessary to do the same with 'current' religions.
i) Man searches for answers. For a reason 'why' for everything. When he can't find a reason why, it's convenient to attribute this to a higher, superior, benevolent force, thereby excusing our own lack of intelligence. ['god of the gaps'].
ii) When there comes a time to take morally reprehensible action to serve our own selfish ends, it's convenient to be able to attribute this to the will of a higher, superior, benevolent force, as it absolves us of our innate sense of responsibility, allows us to justify immoral action. Using popular religion to justify such action can also help to lend credence and mass support to the idea.