I think Yahweh was created for just that reason -- too much pillaging and raping. Think about Islam. Arabia was a wild place. The culture needed some kind of organization and control, so Muhammed created a God who hated lawlessness. One must submit to the Great Lawmaker.
It was easier back then to use magical thinking, rather than secular law, to control folks. Convince a guy that a spiritual Being is watching him, and you can make that guy behave.
Homosexuals didn't make the God. Anti-homosexuals made the God.
Once Yahweh was made, and everyone began to assume that 'God' was this Being-in-the-Bible, then each individual created his own version of God. Lots of gays today view God as fully supporting homosexuality. Their individual version of God is based on the Biblical Guy, but it is a God unique to the person.
That's how it all seems to me, anyway.