The ancient Greeks, inventors of democracy, had immoral gods.
Zeus and his brothers, sisters, wives, and children lied, committed adultery, raped, misrepresented themselves (as swans and eagles, among other things), murdered, and responded to even minor slights with exaggerated vindictiveness and heinous violence.
They were a mess, so much so that the Greeks themselves hardly considered the gods worthy of imitation.
To be fair, Greek deities were poetic inventions designed to represent the forces of nature in human psychological terms. The Greeks never claimed that their gods were nice, no more so than natural forces, which to this day benefit and destroy humanity indiscriminately ... by flood, fire, earthquake, and plague.
Unlike the Greek gods, the god of the three major monotheistic religions (Judaism, Christianity, and Islam) is holy and good.
Apparent inconsistencies in his high moral character (e.g., jealousy, demand for human sacrifice, nonchalance in answering the prayers of his people, even when they were faced with desperate circumstances) have been painstakingly justified by his priests and apologists or dismissed as "non-literal" attributes.
For Christians, for instance, the question "Why do bad things happen to good people?" is important, if hard to answer--because earthly injustices appear to contradict the existence of a God who is all-powerful, all-good, and all-loving. The typical orthodox answer to this question is (1) such injustices are ultimately somehow the result of human sin and (2) who are you to question God?
Despite the fact that Islam has been at work for 1400 years, Christianity for 2000 years, and Judaism for 3800 years, and still human beings kill one another in the name of God (even kill other worshippers of their own God), the popular perception remains, in America at least, that humanity needs religion to be good.
In 2006, Barack Obama, speaking to Call to Renewal, stated that government and politics can and should restrict access to firearms in inner-city neighborhoods, but the young man who fires an automatic weapon into a crowd of people because he feels that he has been disrespected has a "moral" problem beyond the reach of secular reasoning--"There's a hole in that young man's heart--a hole that the government alone cannot fix."
Obama neglects the fact that religious morality, though, has had roughly 19 times the history in which to fill that hole as the U.S. government has had, and still we have young men who kill innocent bystanders--some of whom do so because they feel that their God has been disrespected.
Do we then need religion to be good?
The Greeks didn't. Their religion was a ritualized attempt to explain the ways of nature (pre-modern science) and to persuade their fickle gods to lend them a helping hand now and again.
Greek morality was unrelated to religion. Morality, the Greeks believed, is a matter of reason. Human beings need to behave themselves in order to ensure the peace in society. Humans are capable of reason, and reason alone is capable of instructing us that we personally benefit by seeking the benefit of everyone else.
A simple syllogism in which nothing supernatural is needed:
Major premise: What benefits humanity in general benefits humans individually.
Minor premise: I seek my own individual benefit.
Conclusion: I may benefit myself by seeking the common good (what benefits humanity in general).
Out of this simple trust in human reason, and deduction, the Greeks (specifically in Athens) invented Western democracy.
Democracy, some 1300 years younger than monotheism, emerged from a pointedly secular tradition.
Monotheism, on the other hand, grew out of tribal patriarchies, constantly at war for territory and survival, which eventually evolved into monarchies, emirates, and empires, which justified slavery, imperialism, terror, and the "divine right" of tyrants.
Our democracy then derives from a culture that chose to disregard the bad example of its own badly behaved gods and to embrace secular reason as the basis of ethics and morality.
So, in short, I'm not convinced, despite the rhetoric of Obama and hundreds of thousands of others, that we need religion to be good.
We need reason. We need justice. We need peace. We need the hope of happiness.
But we don't need God.