The reasons for praying for the dead are:
1.The church inherited it as one of the cultural mixups of pagan practices in territories conquered by the roman empire.Traditions die hard especially whenthere are possible benefits like apparitions seen in padua france, of our lady fatima and elsewhere.
2.Man has always venerated the supernatural and most times do not care to distinguish between God and Satan.
3.The Principality for religion always ensure that some type of fears are allayed in the hearts of those who do this so as to encourage them to continue the act even when it is unbiblical.
4.All dead do not go to heaven as the parable of poor lazarus and the rich man teaches us by Christ himself.There is a time appointed for judgement of all men after death after which heaven or hell comes in view.Heb 12