Hi, Dennis08!
I can easily relate to your situation. By the time I went to school (grammar school) I was different from my classmates in two ways. One was that I was smarter and more educated then any of my classmates. The second difference was that I had almost zero social experience. I grew up mostly at home, sitting on a couch, reading books. Such upbringing contributed to both of my specialties.
So on the first day of school I've made a discovery. Paraphrasing Dr. House - "My classmates were idiots!". I've held this belief during most of the school years. While I was generally surrounded by idiot, there were three periods when my classmates were particularly moronic.
One - during my first months in school, before I managed to acquaint myself with some guys and make friends with them.
The second - during puberty, when girls were mean and boys had a real talent of finding "dirty" sexual and therefore "hilarious" meaning in
literally any sentence.
The third - when I entered high-school and within two days managed to alienate the whole class with a couple of well-placed remarks.
I, on the other hand was smart.

I've had the top reading speed, had the best marks until well into high school, and achieved these results with barely any effort, homework or preparation.
By now you probably get the idea that I myself was
a complete jerk, a donkeyhole
an idiot and a snob.
The reason I'm not ashamed to tell about it is that I've learned my lessons, and that I've paid dearly for the privilege of putting myself above my classmates.
Eleven school years were the years of utter misery.
Side note - girls like smart, but like everyone else, they hate snobs.
So, Denise08, of course, you can choose to behave however you want. But be prepared to face the consequences.
If you are blessed by intelligence, tasteful sense of humor and maturity, it will easy for you to see the imperfections in others. But you can not claim the true maturity until you see, that those are not permanent imperfections (although genuine). Most of my classmates grew up as intelligent, smart, nice people. And the "nice" bit came to them much earlier then to me. For several years in college I had to play catch-up in social area, because I didn't bother to socialize with my classmates.
On the other hand "being better" is also fleeting. My advantages led me to stagnation. When my peers worked hard to overcome their limitation, I've stayed in the same place for years. Then, the momentum that they've gained let them surpass me with ease in almost any area.
In fact, my interest with personal development has started, when I've realized, that I won't ever catch up, unless I become more efficient.
To make this post a little bit useful, I'll have a few advices for you.
When is social situation - don't close up. Maintain a friendly posture. Maintain a friendly facial expression. You don't have to laugh at the jokes that you find tasteless, but you can smile voluntary to acknowledge that you are staying with the rest of the people.
You also write about jokes that are not funny. Please remember, that there are no universally funny jokes. The nature of humor is based on a mental gap. If two facts make an unusual and surprising connection for a person - there is humor and the person laughs. Most jokes wear off, once the novelty of the connection wears off. If a joke is not funny for you it is either because the mental connection behind it is not unusual for you (which speaks of your intelligence), or you just don't allow yourself to laugh. Sitting with arms crossed affects your physiology and prevents you from entering "it's funny" emotional state. Just try sitting like this and holding a thought "this is not funny" through something you consider genuinely funny. You might be surprised. On the contrary, if you relax, you may find yourself chuckling involuntary when people around you a laughing. It is natural, however tasteless joke is and there is no shame in it. By the way, it is the reason, why they put laughs in the background of sitcoms - to make stupid jokes laughable.
Your classmates will grow up. They will laugh through the stupid jokes, leave them behind and then move to something more intelligent. It happens at a different pace for every person, but it never happens in the opposite direction.
The alternative, if you are really smart is that you be brilliant and make yourself useful. I've had a classmate, who was a brilliant historian (he still is) but also socially challenged. He didn't try to be too friendly, but consistently performed well in history and was nice enough to help others if they had difficulties with the subject. That was enough for him to become respected.
I don't think that he craved the attentions of others, though.
Or you can remain like you are. Find yourself friends outside school, choose people that fit your intellectual level. The school will suck, but you'll have a place where you can be comfortable. Just don't miss the moment, when your classmates will catch up with you in terms of maturity and intelligence.
Hopefully this changes your view on the situation. The loneliness that you are feeling is avoidable. And you are totally in control.