We Spaniards have been psychoanalyzing ourselves for hundreds of years, trying to understand our behavior towards other countries, peoples, religions, ethnicities, etc. It is true that the black legend has tried to obscure our behavior while trying to hide that of other European countries, but that does not mean that we should forget our responsibility in many truly unjust acts.
The first thing to understand is that we cannot judge the past with our current values because otherwise the whole history of most European countries would be garbage (and not only European countries, also Asian, African and Americans countries were not charity nuns either). Nowadays we are tolerant and democratic because we have understood that it is the fairest system to live freely and with dignity.
The second thing to try to do is to use the terms correctly - only mental idiots like Hitler (or Sabino Arana, who for those who don't know was the founder of Basque nationalism) can think that a person is superior to another because of the color of his skin, his craniometry or his hematotypology, in this sense I don't think anyone of those who participate in this forum nor the overwhelming majority of Europeans are racists, we are already vaccinated against such silly thoughts.
However I think we are all to some extent xenophobic, i.e. we feel distrust or fear towards foreigners, i.e. towards those who are different from us. We worry about losing our welfare, customs, culture, religion, or our political systems because of people who do not fit well in our societies. I think we simply try to defend (rightly or wrongly) what we understand to be ours in this case our country, our civilization or our continent.