Well as one of my friends used to say: "Before you started school, your parents helped you carry around your crap. When you started elementary school, your teachers helped carry around your crap. But once you enter middle school, you start to carry that crap on your own but you just can't and you spill it everywhere on the ground. That's why you need high school, to get your crap all together and then college, to finally attempt to carry that crap on your own." I found that to be quite true.
Point is that when you're in middle school, all these weird things are starting to happen and you don't know what to do. You're going through puberty, you're already expected to become more mature (even though middle schoolers are by no means mature yet), but you haven't really had much of a proper transition. So there you are, freaking out and trying to fit in and I guess being rude is just a side effect of that. Who knows? Most will grow out of it. Some sadly do not.