Sunan an-Nasa'i, Volume 3, Book 24, Hadith 2640 (DarusSalam)

It was narrated that Ibn 'Abbas said: "A man said: 'O Messenger of Allah! My father has died and he did not perform Hajj; shall I perform Hajj on his behalf?' He said: 'Don't you think that if your father owed a debt you would pay it off?' The man said: 'Yes.' He said: 'The debt owed to Allah is more deserving (of being paid off)."'

أَخْبَرَنَا أَبُو عَاصِمٍ، خُشَيْشُ بْنُ أَصْرَمَ النَّسَائِيُّ عَنْ عَبْدِ الرَّزَّاقِ، قَالَ أَنْبَأَنَا مَعْمَرٌ، عَنِ الْحَكَمِ بْنِ أَبَانَ، عَنْ عِكْرِمَةَ، عَنِ ابْنِ عَبَّاسٍ، قَالَ قَالَ رَجُلٌ يَا رَسُولَ اللَّهِ إِنَّ أَبِي مَاتَ وَلَمْ يَحُجَّ أَفَأَحُجُّ عَنْهُ قَالَ ‏"‏ أَرَأَيْتَ لَوْ كَانَ عَلَى أَبِيكَ دَيْنٌ أَكُنْتَ قَاضِيَهُ ‏"‏ ‏.‏ قَالَ نَعَمْ ‏.‏ قَالَ ‏"‏ فَدَيْنُ اللَّهِ أَحَقُّ ‏"‏ ‏.‏

sunnah.com