This story is from the last parva of Mahabharata;  when pandavas/ the King Yudhishthira and his four brothers started their final journey.

Pandavas won the Kurukshetra war. After that; they ruled the kingdom for many years. The king Yudhishthira was the  follower of dharma. His heart was very pure and he never got distracted by the worldly temptations. He was a simple, truthful, kind, and compassionate king.

When the sage Vyasa told Pandavas; that it was the time to retire and renounce their kingdom and start for their final journey ( vanaprasthashram, sanyasa and ultimatly to the heaven as declared by Lord Krishna); they performed the coronation of ‘Parikshit’ their grandson, and commenced the journey towards Himalaya, along with the wife Draupadi.

Yudhishthira was walking and climbing the mountain ( way towards heaven) followed by Bheema, Arjuna, Nakula, Sahadeva and Draupadi; in that order.
After few days of walking and climbing;  Draupadi fainted, fell and died on the way.
Seeing her fell, Bheema asked Yudhishthira; “Why did Draupadi die first, Yudhishthira?”. “Wasn’t  she a virtuous and good hearted ?”

Yudhishthira listend Bheema’s querry carefully. Then without looking back; he answered;  “She was a virtuous and good hearted , no doubt about it. But her too much attachment to Arjuna is the cause for her failing.”

Then after some days, Sahadeva fainted and fell on the way.

Bheema cried and asked Yudhishthira; ” Why did Sahadeva fall? What was his fault?

Yudhisthira didn’t stop walking and without looking back, he replied: “ He was very proud of his intelligence. This is the reason of his failing.”

After that Nakula fell.

Bheema asked sadly , O Yudhishthira, What was wrong with Nakula ?

Yudhisthira replied without looking back: “He was admirer of  his own good and handsome looks. The reason for his failing.”

Soon after that, Arjuna collapsed.

With very grief ; Bheema weeped and questioned Yudhishthira; “What wrong had been done by Arjuna?”

Yudhishthira kept walking without getting moved by these happenings but answered,  “Agreed, Arjuna was brilliant but he was overconfident and conceited and that why he failed.”

Bheema was in very much grief. Seeing his brothers dying one after other, he was unable to bear the pain and sorrow. He was very much tired and at one moment; he was about to collapse but somehow managed to ask his brother the reason for his failing. Yudhishthira replied that his weakness was that; he used to eat in excess and while eating he didnt concern about the other people who were hungry. And also he was too much proud of his physical strength and so he failed.

Thus during the journey toward heaven, four pandava brothers and their wife fell, one by one, succumbing to their weaknesses.

Yudhishthir, the great renunciate and firm follower of the Lord; was the only one left at the end. As he was climbing the mountain, a dog came from somewhere and started walking with him. So many days passed as the way was long. The dog was continuously following Yudhishthira without fail. During this journey, whenever Yudhishthir used to stop and eat the food, he fed the dog too. In this way, they continued walking and climbing. The dog was accompanying him the whole way without fail silently.

Then; finally the time to ascend to heaven came. Lord Indra Himself descended from the heaven in His chariot. He praised the great virtues of Yudhishthira and invited him/ asked him to board the chariot so that they could go to heaven together. Yudhishthira asked Lord Indra to allow the dog to accompany him. He said to Lord Indra, “I want this dog to come with me in heaven.”
Lord Indra told him; ” No, O Yudhishthira!  Dogs can’t travel in this chariot, but only you can…”.  Yudhishthira was the man of dharma. He never thought of betraying his friend, who accompanied him without fail. Betraying such a loyal friend would have been a sinful action.

Lord Indra convinced Yudhishthira, ” To get heaven is the rare thing… so  give importance to your own happiness by abandoning this dog.”

 Yudhishthira said; ” My happiness lies in being loyal to my friend till my last breath. I cannot abandon the dog. He was my faithful companion throughtout the journey. He gave me unconditional love. If I abandon him; I will be in very much grief. And it will be much more compared with the pleasures of heaven. My wife and brothers had weaknesses so they failed and fell on the way. This dog doesn’t have any weakness like them. How can I abandon him? It will be a sin. So please let him come with me in heaven.”

Lord Indra said, “That is not possible, The dog cannot attain heaven.”

Yudhishthira replied;”  If you think that he does not deserve to go to heaven, I don’t want to go there. I don’t want those pleasures of the heaven either.”
And  he started returning….

Seeing Yudhishthira going back, Lord Indra called him and said,  “ You have the great qualities, O Yudhisthira! You are real abider of the dharma. This dog is none other than Dharma and you have descended from him only!”
Suddenly the dog had transformed into the Lord of Dharma / Lord Yama. He blessed Yudhishthira for his complete dedication to the righteousness in all the situations. Lord Yama asked him to enter the chariot without any hesitation.( Lord Yama was the father of Yudhishthira.) Yudhisthira  bowed down to his father and Lord Indra and then boarded  the chariot.

And thus Yudhishthira ascended to heaven in the chariot of Lord Indra.
The gates of heaven were opened for him, dwarpals welcomed this virtuous king in the chariot of Lord Indra.
He sees his brothers and wife also there in heaven. He was very much pleased by meeting them.
Thus; all this was a play of the supreme Lord only, to test the Yudhishthira. The Lord Himself took the form of the dog to test the Dharmaraj Yudhishthira’s dharmanishtha and witnessed his unnerving kindness and compassion. Yudhishthira proved to be the most righteous.
Thus the story ends.

Now, don’t think much about whether this  Mahabharata story is real or fictional. We hear many stories in puranas and upanishads. These are not mere stories but they have logic and message in them for us.

Let’s not question; how can one travel oneself towards heaven; why this and how come that, and so on. Let’s just try to extract good and positive ideas from it to inculcate them in our life for our own betterment.

Bheema, Arjuna, Nakula, Sahadeva and Draupadi had sufficient balance of good karmas/ merits;  that’s why they were in heaven. But even they also met a fall because of their one weakness. What about us? How many weaknesses we have? Isn’t it a time to work on them?

Are we following dharma/Guru’s words for sure?
We can know everything about dharma/ righteousness from our scriptures. Are we reading and refering them regularly? When our time will come, how much balance of good deeds/ merits we will have?

Yudhishthira did not run away from his duty towards dog. To fulfil his duty; he even refused the offer of heaven by the Lord Indra.  We see many people discarding the pets when they see them as burdensome. 

Responsibility should not be taken lightly. It is usually  seen that when people get the higher place/ post, they forget their responsibilities towards old things and beings. They break the commitments.

How easily Pandavas; the ultimate winners agreed to renounce and retire from the pleasurable life!  If we observe our own life and our surroundings carefully; ‘n’ number of problems are seen arising daily because of too much attachments with the things, beings, places, jobs, beliefs, etc. Quarrels at domestic level, disputes at social level, corruptions, riots, agitations, etc are  because of the hoarding and snatching tendencies of the people.

By observing the negative effects of Pandava’s weaknesses on their fates,  we can learn many things so as to overcome our own weaknesses, habits and addictions, like-
We should not be partial or show inaquility in loving others.
We should not be proudy or boastful about our skills, looks and intelligence because these are gifted by the God only. Rather, one must be grateful to the God for giving us such skills. One should use these God gifted skills for betterment of the society along with our own spiritual upliftment.
We should eat our food just to maintain our physical body as a vehicle for our spiritual journey. We should take  due care of those who are hungry in our surrounding because of the lack of food. Overeating without offering food to the hungry is not dharma.

God checks our every activity and its motive behind it. Everything gets counted and stored. People may not see our activities, they may not read our minds for our motives but Lord is Sarvajnani. In this story, God was testing the honesty and righteousness of Yudhishthira, by creating difficult situations before him.

‘Heaven’ mentioned in this story is the state where there is no pain, sorrows, disease or distress. There is only enjoyment and enjoyment. As per advait vedanta, it is not the ultimate goal of human life. Because afterall heavenly experiences are not eternal. Once the merits are over, one has to return to the earth to get new birth to exhust the remnent karmas. (3rd adhyaya of Brahmasutra).

Suppose you wish to go to Singapore to enjoy. So, for that, you start arranging sufficient money. Then you go to Singapore and enjoy there. But when your money gets finished there, you have to come back to your city to continue your previous work.

Sanchita karma is uncountable which includes good as well as bad karmas. Current birth is the result/ fruit of our karmas; from this sanchita karma, which were ready to get exhausted( ripened/ prarabdha). If we have sufficient accumulated merits/ good karmas, we will attain the heaven. But we have to come back on earth when our merits will over. We will have to take another birth as per our remnent karmas.
And this will repeat again and again…till our all karmas get exhausted, which is impossible. Because while exhausting prarabdha, we are creating more new karmas, and those will get added in sanchita karma again.

To end this cycle, there is the only one solution. And that is the Self- Realisation. All the sanchita karmas get burnt in the fire of the knowledge. Once, one realises own real nature, one creates no agami karma. His physical body remains till the end of his prarabdha karma. For such master, there is no rebirth…He goes nowhere..He needs no path to go anywhere. He is the Non dual Brahman.  Brahmvid Brahmaiva Bhavati. Only for the ignorants, there are the paths, heaven and the hell.
    Hari Om !

Image source- Internet.7