salaam Sardar,
As brother Joseph explained on another thread:
This assertion is usually a result of an isolated reading of Quranic passages such as verses 5:51 and 3:28 which advance a general prohibition.
Verse 5:51 that you have kindly shared (as well other verses such as 3:28) cannot be read in isolation. This theme is clarified in other verses where the prohibition is only against those (non-Muslims) that are bent on making a mockery out of the religion and causing strife.
Those astute with Quranic methodology should be aware that many verses of the Quran are elaborated in other parts of the Quran and any 'summary' verses should ALWAYS be understood in light of the more elucidatory verses.
If one just relied on verses 5:51 and 3:28 alone, one could/would conclude that the prohibition was absolutely against not only the disbelievers but also the People of the Book without distinction.
However, verse 5:57 provides the elucidatory narrative and the complete context:
"O ye who believe! take not for friends / allies / protectors (awliyaa) those who take your religion for a mockery or sport / ridicule or fun (Arabic: huzuwan wala'iban), whether among those who received the Scripture before you, or among those who reject faith; but fear ye God, if ye have faith (indeed)" [Quran 5:57]
The above verse clearly clarifies both verses 5:51 and 3:28 by including both categories and makes it clear that the prohibition is ONLY restricted to those that take religion for a mockery or sport / ridicule or fun (Arbaic: huzuwan wala'iban).
The same word 'awliyaa' that was used in 5:51 is again used in the above verse (5:57) but the context has been clearly elucidated (in 5:57) against those who are deemed 'trouble-makers'.
But as for those who have never shown any difficulty or animosity whether from the People of the Book (meaning Jews and Christians) or Disbelievers, Muslims are expected to show them kindness and deal with them justly, as evident in the following verse:
"God does not forbid you respecting those who have not made war against you on account of (your) religion, and have not driven you forth from your homes, that you show them kindness and deal with them justly; surely God loves the doers of justice" [Quran 60:8]
With that said, The Quran is best understood when verses do not conflict with one another (or when a command in one verse does not conflict with or contradict the command of/in another verse). So the idea that we (Muslims) are forbidden from taking Jews and Christians as friends is in clear contradiction of the Quran. And here's why: God has told us Muslims that we are free to marry from The People of the Book (as per verse 5:5); so how can the Quran/Islam, on the one hand, supposedly forbid taking non-Muslims (in particular Jews and Christians to be exact) as friends while, on the other hand, making it lawful for Muslims to marry members from those religions (5:5)?
Please always bear in mind that: We must always be aware of reading passages in an 'isolated manner' and should be prepared to subject the Quran to a thorough reading / understanding of its complete narratives.
And, always bear in mind that: many verses of the Quran are elaborated in other parts of the Quran and any 'summary' verses should always be understood in light of the more elucidatory verses.