"Do you order people to righteousness and forget yourselves?" meaning: you abandon acting upon it, "while you recite the Scripture," contrary to what you do. "Then will you not reason?" regarding what you enjoin? He means by that their rabbis.
Muhammad said: It has been narrated from Ibn Abbas regarding the interpretation of "Do you order people to righteousness?" that he said: It was revealed concerning a group of Jewish rabbis. A man among them would say to those of his relatives who had embraced Islam—when he trusted them in secret—: "Remain firm in what you are upon, from what this man enjoins upon you"—meaning Muhammad (peace and blessings be upon him)—"for it is the truth," yet they would not practice it themselves, for the sake of the leadership they had attained and the wealth they were consuming. So Allah uncovered their secret and informed [others] about them concerning that.
﴿أَتَأْمُرُونَ النَّاسَ بِالْبِرِّ وَتَنْسَوْنَ أَنْفُسَكُمْ﴾ أَي: تتركون الْعَمَل بِهِ ﴿وَأَنْتُمْ تتلون الْكتاب﴾ بِخِلَاف مَا تَفْعَلُونَ ﴿أَفَلا تَعْقِلُونَ﴾ مَا تأمرون بِهِ؛ يَعْنِي بذلك أَحْبَارهم.
قَالَ مُحَمَّد: جَاءَ عَنِ ابْن عَبَّاس - فِي تَفْسِير ﴿أَتَأْمُرُونَ النَّاس بِالْبرِّ﴾ قَالَ: نزلت فِي قوم من أَحْبَار يهود؛ كَانَ الرجل مِنْهُم يَقُولُ لمن أسلم من ذَوي قرَابَته - إِذا وثق بِهِ فِي السِّرّ -: اثْبتْ على الَّذِي أَنْت عَلَيْهِ؛ مِمَّا يَأْمُرك بِهِ هَذَا الرجل؛ يعنون: مُحَمَّدًا عليه السلام فَإِنَّهُ حق، وَلا يَفْعَلُونَهُ هُم؛ للرياسة الَّتي كَانُوا حازوها، والمآكل الَّتي كَانُوا يأكلونها؛ فكشف اللَّه سرهم، وَأخْبر بذلك عَنْهُم.