There are many halakhot (laws), minhagim (customs) and aggadot (non-legal points statements) that view gentiles in a negative light.
Looking at Judaism to the historical reality in which it developed, this is understandable. In the Bible, the Israelites were the only monotheists, and were surrounded by people who hated them. Israelites suffered near-genocidal wars against them. As such, the Bible’s polemics against pagans are completely understandable. There are no Biblical racist attacks against all non-Jews in general, God is clearly described as a God of all people, but polemics against pagans are clearly there.
This carries over into the classic works of rabbinic Judaism: the Mishnah, the two Talmuds, and the various Midrash compilations. The rabbis writing during this era (200 BCE to 800 CE) were surrounded by people who hated them. This includes what we see in the writings of the Church Fathers : anti-Semitic diatribes that are so specific and violent, they have incited followers to murder Jews in the name of the Church for nearly two millennia. As such, it is not surprising that classical rabbinic literature has polemics against not only pagans, but against Christians, – nearly all of whom, at the time followed the teachings of the Church Fathers. Jews knew of no gentile society in which we were treated as equals, as human beings.
During the Golden Age of Jewish life on the Iberian peninsula (700 CE to 1100 CE) , while not ideal, there were some sustained periods of tolerance and intellectual respect by both Christians and Muslims towards Jews. In this age and region, Jews, Christians and Muslims occasionally worked, traded and intellectually sparred together in a way not to be seen again until The Enlightenment (18th century Europe and America)
Since the The Enlightenment, Jews have lived more often in communities where non-Jews treated Jews as equals, as human beings. Modern liberals do need to “check their privilege”, as the saying goes, because even then, Europe teetered from there towards the Holocaust, and large pockets of anti-Semitism are still flaming up across Europe, America, and the middle-east. The majority of non-Jews still do not treat Jewish people as equal, even to the point of denying Jewish people the right to exist as a free people, within safe borders, in their indigenous homeland, the land of Israel (yes, anti-Zionism is anti-Semitism.)
So where does that leave us today? If you are traditionally observant, the codes of Jewish law do not always have us treat non-Jewish people with respect. There are aggadot, non-legal midrashim, which view non-Jewish people as having essentially no purpose, other than the value they have of potentially serving Jewish people in some way. In historical context, this view is less dangerous and violent than the 2,000 years of gentile calls for Jewish submission, conversion or extermination! Yet it certainly is inconsistent with today’s liberal views of equality (at least, among the few people today who actually are tolerant to all, including to Jewish people.)
There is little that we can do to change the behavior of those who treat us disrespectfully. But we can change our interpretations of these classical rabbinic texts, so that at least we can say : being a light unto the nations means treating and talking about others should be done in the same way that we’d have others treat us. This is the golden rule of Rabbi Hillel.
Rabbi Dr. Nathan Lopes Cardozo, has written articles (How Halakha Must Transcend Itself) on this topic. He grew up in an environment in which non-Jewish people treated Jews as equals, actually married Jews, and most amazingly, in which people who were not halakhically Jewish even considered themselves to be in some way part of the Jewish people! But upon becoming strictly religious, perhaps ultra-Orthodox, the young Nathan Cardozo, found that he had to treat non-Jewish people in a way that hurt their feelings, a way that only caused people to move apart, instead of together, and which exposed some bigoted feelings among some in the Jewish community This episode had a great effect on the progressive Orthodox rabbi that Nathan Cardozo would later become.
Historical context allows us to understand why the ultra-Orthodox take so seriously the aggadot that describe gentiles in a dismissive light. But at the same time, two wrongs do not make a right. Many of us live in a world where non-Jewish people treat us as equals, and so it is incumbent upon us to interpret our own traditions in a way that speaks to the common equality and decency of all humanity.
As such, I would like to recommend reading this piece by Rabbi Cardozo.
I should point out that his piece is aimed at an Orthodox Jewish audience; the changes in teaching and practice that he is proposing have, in practice, largely already been adopted by those in the Conservative & Masorti Jewish communities (see for example the works of Rabbi Elliot N. Dorff, and the responsa of the Committee on Jewish Law and Standards)