Even though humanity has reached the stars and met other races more primitive or advanced, more agressive or peaceful, still racism is written in human history. Maybe racism against each other amongst us people has seized, but racism has found its new form: Xenophobia.
In science fiction xenophobia means hatred or fear of foreigners or strangers or of their politics or culture from other races outside of humanity. Also other alien races can be xenophobic towards humans or other alien races.
If there are space travels, different worlds and cultures and that evil spawning race threatening all known civilization - human or non-human - why there is xenophobia?
For the same reason it has always existed. Fear of different, uneducated mind, fear of higher power or fear that lower civilization can somehow ruin your own. And in some spacestations or busy spaceports locals might feel that all other beings, races and aliens are some kind of threat for their living and their culture. Maybe they are afraid of change and in that fear it doesn't matter if the change would be good or bad.
To understand xenophobia in science fiction you just need to look at written history. It is the same. Reasons are same. Only in future the target might have bigger space ships with weird technology or their skin might be blue.