Religion is a oversimplification of philosophy doctrines. Imagine Moses trying to communicate with regular folk his views on the world in a way that Socrates did. It was much more efficient to translate it to a set of stories that impose specific behavior.
The closest religion to philosophy (I can think of) is Buddhism, it is basically a guide to learn about self and the world.