The gods mankind write for themselves have to have a basis in something. Animistic gods are based on the powerful or cunning animals native to their area of power. The old Olympian gods reflected the culture and prejudices of their times. And the god of Abraham?
Dawkins puts it well in The God Delusion when he says
The God of the Old Testament is arguably the most unpleasant character in all fiction: jealous and proud of it; a petty, unjust, unforgiving control-freak; a vindictive, bloodthirsty ethnic cleanser; a misogynistic, homophobic, racist, infanticidal, genocidal, filicidal, pestilential, megalomaniacal, sadomasochistic, capriciously malevolent bully.
This god takes all of the worst characteristics of humanity. Notably, his worst characteristics are the things that are in keeping with the times – misogyny, homophobia, and infanticide were all part of Bronze Age culture to some degree, and so he is the epitome of these things. Many of the other characteristics reflect the fears of his age – pestilence was a great threat, so his ability to control it was symbolically important. Ethnic cleansing was another fear – peoples in that time enjoyed wiping each other out regularly, and to have a god that could control that was to have an advantage over other peoples, and to have a better chance at surviving.
But what about the god of the new testament? Christians often claim that the old testament is, well, old and that the revelation of the new testament shows us a more personal god, who is more about love than legalism.
The new testament god is often spoken of as a god of love, mercy, kindness, grace, and forgiveness. Why would the early Christians re-casting their god in this way? Much of it may have been to do with the historical context they lived in.
Christianity sprang up under the Roman Empire, at a time when Rome was expanding its rule over myriad new peoples. The Romans were not gentle rulers, and their gods echoed the people. Mars, most Roman of gods, led them to war and conquest.
Under the Romans, the Christians and the Jews they derived from were second-class citizens. They were alien, different, the ‘other’ to the Romans that ruled them. In this climate, what they needed, and what they created, was a loving and accepting god. Theirs was a god for the disenfranchised, who rose to become the god of the entire empire.
Modern interpretations of this god vary wildly, from the liberal “god is love” to the ultra-conservative “god hates [everything]”. Each of these interpretations is heavily colored by the context in which the god has sprung up – in China, they need a god of love, while in America, they have the freedom to call down a god of hellfire.