Mind you, this begs the question of which came first: religion or philosophy. But I don't see the two as separate. I think they are conjoined twins. A person can't hold religious views without adopting the particular philosophical biases that undergird them. For example, Christianity sprang out of Hellenistic and Stoic philosophies. That is, the undercurrent of thought in Christianity is primarily Platonic. Christianity, as it were, is founded on Platonic thought.
Many is the objector to that notion, believe me. But there's no denying the parallel between Plato's perfect and derivative forms theory within Christianity. The core doctrine of Christianity, the incarnation of God in the man of Jesus, is exactly that: God, the perfect being, takes on the skin of a man, an imperfect and derivative (image and likeness) being. Yes, the notion of imago dei pre-existed the neo-Platonic Christian teaching of the incarnation. Yes, the Hebrew peoples saw humanity as directly linked to God. But this overlap doesn't invalidate my point, it affirms it: religious and philosophical querries are inseparable; they reinforce and build on each other.
So, Plato, being the philosophically savvy individual that he was, looks at the world around him and comes up with a speculation for what, why, and how things are. Hundreds of years later, the Jewish peoples host that same idea, but couch it in the notion of God dwelling with his people. The same ideas were birthed in the stories of Horus, Mithra, and Vishnu, to name a few. There is a common element amongst these religious views: the idea that the perfection that is God willingly reduces to the imperfection of man to show man how to behave and play well with others.
Great! But some burning little questions now heat my mind: what's to say that God simply isn't just a product of philosophy? That is, when human reason meets its limitations but intuits there may be more, is the notion of 'God' just a dumping ground, so to speak, for future speculations? Speculations that might carry with them more of the collective human experience; more of the newer, more refined attempts to understand what we haven't understood before? Might 'God' just be a linguistic application we employ to say "I don't know" but at the same time keep an empathic connection with our fellow creatures?
It's an interesting idea to think about. For me, at least. You can take it or leave it as you see fit. For now, however, I'm not so sure that 'religion' and 'philosophy' are creatures of a different kind. I think they're versions of the same thing: a cultural narrative.