Let's briefly check what the Quran says about Hajj and the concept of dedicating your good deeds to others.
The other very important information contained in the Noble Quran is the truth about the independence of each soul created by Allah. Allah says in the Quran, loud and clear, that every soul is responsible and answerable for its own deeds. This concept is one of the cornerstones of the Glorious Quran.
"And guard yourselves against a day when no soul will in aught avail another, …" (2:48)
"That no laden one shall bear another's load," (53:38)
"And that man hath only that for which he maketh effort," (53:39)
"And a soul and Him who perfected it
And inspired it (with conscience of) what is wrong for it and (what is) right for it.
He is indeed successful who causeth it to grow,
And he is indeed a failure who stunteth it." (91:7-10) Ash-Shams
The idea of Hajj-e-badal has crept into the Muslim culture through the stories of Hadith. From all the Quranic evidences provided above, it's not at all hard to perceive that the concept of Hajj-e-badal in Hadith is NOT compatible with the Quran, rather it quite obviously clashes with Quranic principles.
The following are the UNAUTHENTIC Ahadith that are responsible for bringing this unwarranted practice within Islam.
A woman came to the Prophet (saws) and said, "My mother vowed to perform the Hajj but she died before performing it. Should I perform the Hajj on her behalf?" He (saws) said, "Yes! Perform the Hajj on her behalf. See, if your mother had been in debt, would you have paid her debt?" She said, "Yes." He (saws) said, "So you should pay what is for Him, as Allah has more right that one should fulfill one's obligations to Him."
Sahih Al-Bukhari Hadith 2.589 Narrated by Abdullah bin Abbas
Al-Fadl ibn Al-Abbas was riding behind Allah's Messenger (saws) and a woman from the tribe of Khath'am came. The woman said, "O Allah's Messenger (saws)! The obligation of Hajj enjoined by Allah on His devotees has become due on my father and he is old and weak, and he cannot sit firm on the mount; may I perform Hajj on his behalf?" The Prophet replied, "Yes, you may." That happened during the Hajj-al-Wida (of the Prophet (saws)).
Sunan of Abu-Dawood Hadith 1806 Narrated by Abu Razin
A man of Banu Amir said: ‘O Messenger of Allah (saws), my father is very old, he cannot perform hajj and umrah himself nor can he ride on a mount.’ The Prophet (saws) said: ‘Perform hajj and umrah on behalf of your father.’
The rule of Hajj-e-badal being performed by a person who has already performed Hajj for himself first comes from the following Hadith:
Sunan of Abu-Dawood Hadith 1807 Narrated by Abdullah ibn Abbas
The Prophet (saws) heard a man say: ‘Labbayk (always ready to obey) on behalf of Shubrumah.’ He (saws) asked: ‘Who is Shubrumah?’ He replied: ‘A brother (or relative) of mine.’ The Prophet (saws) asked: ‘Have you performed hajj on your own behalf?’ He said: ‘No.’ The Messenger of Allah (saws) then said: ‘Perform hajj on your own behalf, then perform it on behalf of Shubrumah.’
I ask the mainstream Muslims, in the presence of the Noble Quran, would the Prophet (pbuh) so authoritatively overlook Quranic laws and principles and implement his own rules that contradict the contents of Allah's Final Message? The answer is a firm NO.
Conclusion: Hajj-e-badal is not a Quranic law and it clashes with Quranic principles.