O you who have faith! Do not take the Jews and the Christians for allies: they are allies of each other. Any of you who allies with them is indeed one of them. Indeed Allah does not guide the wrongdoing lot. (5:51)
In addition to what has been said, my understanding of this verse is with respect to the meaning of "wali/awliya" as putting one's self under someone else's authority. That is, one should not put one's self under the authority (in the sense of dependence or giving over power of one's self to someone else, e.g. politically, financially, personally) of someone who is not Muslim in such a way that one loses control over one's life or society and cannot easily recover it.
To my understanding, one of the principles of the early Muslim community was self-definition and self-sufficiency. It doesn't mean that one cannot be friends; friendship is different from disempowerment. To see the results of political or economic disempowerment, one can look at what happened during the colonialist era as an instructive example. (I am not saying that European colonialism was a morally Christian act, but just that this is how these dynamics can play out in the real world)
I would like to add that, in this day and age, no one would argue the reverse; that is, none of the Western countries (which are somehow connected to the Christian heritage even if they are not necessarily "Christian") woud put themselves under the political, legal, financial, or cultural authority of Muslims, yet no one says that this is prejudiced.