some are sure to disagree, but thats fine, these are just my ideas and what i put the most faith into. From years of thinking and reading others ideas. Funny thing is i latter read Edgar Cayce's views which seem pretty much the same.
God is consciousness. In the begining, God wanted to share existence with others with free will, so he divided his consciousness into many. To exist outside of god a spirit realm was created where individuals could explore their individuality and free will. After so long it ended in disaster by individuals so fixed on the reality they created that they forgot their connection with God.
Thus the Physical realm was created by God as a learning world, where you could be born, learn, die and be reborn as a reboot type system to give you unlimited chance to re-connect with God. And the purpose of the physical realm is to re-connect with God, when you finnaly do you reach a state called full enlightenment(self-realization), you have then found your way back with god. When you die you still remember, at that point you can do whatever....rest with God, or choose to be reborn.
I'm aware there may be flaws, i don't see it as i have it all figured out, but thats the closest i can get. I feel better anyway, and its leading to a fearless and happy life.