since we all will eventually die, religion was created to try to explain what happens after. And since different people had their own version of the afterlife, different religions were born. All had a common theme though, reward and punishment, which is a very human construct of carrot and stick.
To the average human, being nothing after death is a thought more dreadful than death itself. And since on earth, we had a father who loved, nurtured and took care of us (at least most of did), we created a father God to do the same in the afterlife. Because it's psychologically more comforting.