Don't wear a Puerto Rican shirt in "America"

You know, it's weird, but I'm not sure how much is learned behavior and how much is inborn social bias...

I teach middle school. There is a pretty fair amount of fraternization between kids of all races at this level. Then you see those same kids when they get to high school (we share a campus) and there's already some obvious self-imposed segregation starting to happen.

And anecdotally, a lot of my friends from school growing up who never displayed any kind of racial bias at all (and indeed would hang out with black, Hispanic, Asian, etc. students like it was not big thing) have, in adulthood, turned into card carrying MAGA types (or in some cases full blown alt-righties) screeching about race constantly.

I think the sad truth is we're hardwired for tribalism and race presents the easiest way to separate people into groups. And whatever the reason, my observation is that those things tend to increase with age. It's not really kids that are the issue, it's adults. Maybe it's learned behavior, but I've seen enough of it manifest that I can find no parental influence on that I believe there are other factors at play.
sure, bit not just for tribalism
we have impulses both for security and for exploration - if i was to make up a % i'd say 80% of us have a predominate trait for cave dwelling (security) and 20% of us with the dominate trait for hunting/exploring/novel experience
BUT i also feel pretty strongly that we possess both traits - so if all of out hunter die, 20% of the remaining cave dwellers would "discover" the trait for exploration

and aside for secutiry, i don't see much about biology that favors homogeneity over heterogeneity - so while we can appreciate that like wants like (more often) there's no reason to encourage it - especially in an educational environment, since exposure to new ideas, perspectives, learning styles is a net educational gain
when i had lunch duty, i would often thank those lunch tables that were mixed ("hey thank y'all for having an inclusive table") and like you're saying it was precious few - if there were 50 tables, 3 -5 of them might have been mixed
i wouldn't chastise homogeneous tables, but i would definitely support diversity