A lot of his theory concerning religion is based on the assumption that people are using God as a father figure. As you probably know, Freud was a big proponent of the idea that children have a sexual attraction to the parent of the other gender. God functions as an unavailable father figure for the kid in that case; the boy will never grow up and supplant him (since he's ageless) and the girl will never experience any physical sexual relationship with him (since he's a spirit). It gets even more weird, I've included a link for you.
Now, this is deep midnight and i am to take dinner and go to bed. But one thing i tell u friend, freud does not tell anything without sex. Therefore, examine properly but i am going to bed. Meet u next session.