if a gene establishes itself within the genepool of a group, that is because it has been beneficial to every individual (and the genes that survive through that individual), by it's own merit - not by merit of being widespread in the group already, along the way.
Of course, no one has ever seen this in action, so it's pretty unlikely that group selection is very important in evolutionary history.
If you treat "race" as a word meaning "extended families that reproduce to some extent," then you have a great evolutionary argument for in-group altruism. By being slightly sensitive to race, you allocate slightly more resources to your own set of genes, meaning that people who share your genes, in turn, have more resources they can allocate back to you. In conditions of scarcity, that really helps. However, I don't know if it helps enough to deal with defectors (i.e. if there's a group that allocates lots of resources to group members, someone born with a "mooching" gene could afford lots of kids. It is basically the same math that wrecks cartels, just on a longer timeline).