Another practice of the people of Jahiliyyah was that they would deny even those matters which they themselves admitted belonged to their religion, as was their conduct regarding the Hajj to the House of Allah. They denied it and declared their disavowal of it, even though they admitted that these were matters of their religion, as Allah says:
وَإِذْ جَعَلْنَا الْبَيْتَ مَثَابَةً لِلنَّاسِ وَأَمْنًا وَاتَّخِذُوا مِنْ مَقَامِ إِبْرَاهِيمَ مُصَلًّى
“And when We made the House (the Ka’bah) a place of gathering for the people and a place of safety, (and commanded:) take the station of Ibrahim as a place of prayer.”
He also said:
وَمَنْ يَرْغَبُ عَنْ مِلَّةِ إِبْرَاهِيمَ إِلَّا مَنْ سَفِهَ نَفْسَهُ وَلَقَدِ اصْطَفَيْنَاهُ فِي الدُّنْيَا وَإِنَّهُ فِي الْآخِرَةِ لَمِنَ الصَّالِحِينَ ٭ إِذْ قَالَ لَهُ رَبُّهُ أَسْلِمْ قَالَ أَسْلَمْتُ لِرَبِّ الْعَالَمِينَ ٭ وَوَصَّى بِهَا إِبْرَاهِيمُ بَنِيهِ وَيَعْقُوبُ يَا بَنِيَّ إِنَّ اللَّـهَ اصْطَفَى لَكُمُ الدِّينَ فَلَا تَمُوتُنَّ إِلَّا وَأَنْتُمْ مُسْلِمُونَ
“And who would turn away from the religion of Ibrahim except one who is very foolish? We chose him in this world, and in the Hereafter he will be among the righteous. When his Lord said to him: Submit, he said: I submit to the Lord of the worlds. And Ibrahim enjoined this upon his sons, and so did Yaqub (saying): O my sons, Allah has chosen this religion for you, so do not die except as Muslims.”
The reason for the revelation of this verse is stated to be that Abdullah bin Salam (may Allah be pleased with him) invited his two nephews, Salamah and Muhajir, to accept Islam, and said to them: You know that Allah the Most High said in the Torah: I am going to send a prophet from the descendants of Ismail whose name will be “Ahmad”; whoever believes in him will find right guidance, and whoever does not believe will be accursed.
So Salamah accepted Islam and Muhajir refused, upon which this verse was revealed.