Just to make my point crystal clear about rationality and the benefits of discrimination and systematic racism. Imagine out of 1000 black people 50 are violent criminals, 100 are well-educated, highly paid professionals, and 850 are just regular Joes. For 1000 white people we have 20 violent criminals, 150 well-educated professionals, and 830 regular Joes. Whom would you like to see following you in a dark alley? I would prefer it to be well-educated professional. My second best is a regular Joe. I do not want it to be a violent criminal. Now, what if I only have to choose if it is a black or white guy, and the exact guy will be chosen from a corresponding population at random. Based on simple probability, I would like it to be a white dude.
Now, does it mean that blacks are more violent? No. Most likely, violence depends on the environment where they grew up, and more blacks grew up in poor households and witnessed violence in their childhood (and had to be violent to survive). If I know it, will it affect my decision between black or white guy in that dark alley? Hell no! It is still better for me to see a white dude there. So, we are done proving that systematic racism and discrimination is rational
Now, why it is beneficial for the majority. Even in my example above, ALL people (including black violent criminals if they are not there to commit the crime) would prefer to see a white dude following them. So, everyone benefits from discrimination at some point. Furthermore, if we assume that the discriminated group is the minority, only they will suffer from discrimination. So, the majority will benefit. Finally, if we are talking about immigration, we discriminate against certain countries/nationalities who are not our citizens yet, so, ALL our current citizens will benefit. And we are done proving that the majority benefits from discrimination.
Now, is discrimination "unacceptable". To answer this question, we need to define what we mean by "unacceptable". If it means "immoral" from the point of view of the majority of the population, then yes, it is unacceptable. When people have enough wealth, they start caring about other people and think of "justice". For example, if you can rob someone of $1,000,000 and know for sure you will not get caught, will you do it? The rational thing is to do it, but most people will not do it because they believe it is "unacceptable" from a moral perspective. And people who have a roof over their heads and food to it can be generous enough to behave based on their morals, not rationale. And they may be willing to spend money to eliminate that confounding factor (poverty) behind the race difference. So, racism/discrimination is unacceptable in a prosperous society. However, just a note on this "confounding factor," when immigrants come to Canada and do not assimilate but instead continue to segregate themselves based on their former nationality or religion, we, as a country, do not do a good job of eliminating that confounding factor.