In Ender's Game, the students in the Battle School are still students with all the racial and ethnic stereotypes still operating within the groups. As the above answer explains, you would think in such an advanced society, prejudice would not happen. However, because Ender is to be a military leader, he is deliberately isolated, just as other commanders are. To be a miltary commander means that you must think for yourself, never believing that anyone else can rescue you. The bullying, racism and ethnic slurs happen because the students are fighting to be the best, to be the leader of an army, to be the commander of the armies of the Battle School. One way they see to get ahead is to make everyone else less than themselves. Petra, a girl no less, is also one of those teased, but helps Ender find his way. Bonzo, the military commander of the student Salamander army, picks on Ender constantly, resulting in his unfortunate death by Ender. I think if you put that many students in one place, pit them against each other to see who is the best, and encourage the isolation of leadership, stereotypes of every kind would be the expectation.
There are a few reasons why it may seem surprising to have racial and ethnic stereotypes in Ender's Battle School, especially in a futuristic setting.
First, stereotypical behavior is limited behavior. In a futuristic society, we would assume that primitive behaviors such as stereotyping and racial separation would be extinguished, after all, as society moves into a faster and more intellectual future the need to come together as one united front is quite real. How else can the human race move forward unless it does it as a whole?
Second, although in Ender's Game does show a unified human race battling against the "Buggers", it seems as if there is still an innate human tendency to differentiate ourselves from others and emphasize on the unique traits that make us who we are. This occurs in the form of the sense of patriotism, religious adherence, and racial pride shown by the secondary characters. Bonzo exaggerates his Spanish background, Rose the Nose is emphatic in speaking about his Jewish heritage, and Alai professes his Muslim faith. Although the fleet is meant to be an international fleet, Orson Scott Card brings out this unique quality in all humans: that specific love that we all tend to have for our past, and the sense of pride it instills within us. In not so many words, no matter how much time and technology changes our society, our sense of who we are will never change us.
In conclusion, Ender's Game focuses more on the isolation and alienation that come as a result of being different, unique and possessing of the skills that others deem essential, but that they lack for their own good. When a society is as advanced as it is in Ender's Game, there is the assumption that long gone are the preoccupations on shallow things such as race, creed or color. Although they do see to be a thing of the past, other differences do surface in the form of patriotic or religious fervor. Either way, in the end, isolation and alienation remains and it is obvious that the difference that so-call define us are still quite shallow and skin-deep.