In my Middle School days, this was exactly how things were. I bussed out to a school on the other side of town to take "Challenge" courses, ones a step higher than the Advanced classes. Compare them to the relationship between AP and Honors classes in HS. Within that school, the kids in regular classes hated us, most of them being of the skater/surfer crews. We didn't have the tans, the Hollister clothes, or the sun-bleached hair that they had. For those of us that bussed in from a poorer area, it was even more of an issue. We didn't have the rich families they had, meaning we didn't have the newest clothes, phones, and other things they had. Hell, most of us were lucky to have a parent with a cell phone!
Moving into High School, it changed a bit. I was going to school in my area again, the poor side of town. There was a sort of camaraderie between the students, all having grown up in the area. Even so, you'd still see those that played sports, went to the beach, did drugs, and had tons of sex disliking those that preferred to keep to themselves and their studies. There were exceptions, certainly. Even I, being a bit of an introvert at the time, gained a bit of notoriety within the school, and couldn't walk down the hall between classes without throwing up a few high-fives.
Even so, if you don't care about the popularity, it can still bite you in the ass. Friends with a popular person that doesn't want their friends to see them around you? You're fucked. Want to not be picked last for gym, even though you're great at the sport? You're fucked.Want to be invited out to large group gatherings, not personal hangouts at a friend's place? You're fucked.
It is what it is, and you learn to deal with it. Hopefully you gain valuable experience for dealing with such people later on in life.