I believe that the concept of afterlife was promoted in religion as a control mechanism. Its obvious that, with time, people would start to realize that the ones doing bad deeds aren't being punished & good people don't necessarily lead comfortable lives. How to counter this - tell people that they would be judged after they die. Simple, problem solved. No one is gonna come back from the dead to tell the masses otherwise.
This reminds me of of a long conversation I had with a christian friend. He talked about the bible saying - Give your life to me & you will have a life. When I asked him about the many good christians who suffer(a few months before we talked there had been anti-christian riots in a state in India) and he said that its also written that if you suffer you shouldn't despair. Thing will improve, if not in this life, in the after life. I couldn't stop laughing when he said this. Its basically the bible covering its ass with both hands. No matter what the outcome people have no way of disputing the bible on this if they believe.
If there wasn't the promise of heaven then there would be more non-believers than there are today.