There are some people in life who go through school being a "loser", but who are too thick-skinned to care. They therefore get the mates (by just being bolshy enough to push themselves into the centre of the group), speak up in class (because they don't have much self-awareness), and, in this way, change from being a "loser" to being a "normal" person.
However, there are some people, like you, who are much more sensitive. Perhaps they're not accepted straight away by other people because they're new or different, and perhaps they're scared of speaking in class because they're worried they'll make themselves look a fool. There's nothing intrinsically wrong with you which makes people not like you; you're just different, and that's totally normal. Some people just don't click with some other people, through no fault of their own. But you say you have got friends, which is brilliant - just because you don't really get on with anyone in one particular class doesn't make you a loser! As long as you're always civil and polite and friendly to the people in that class, they've got nothing to complain about.
And neither does your teacher. That's absolutely appalling that he asked the class to rate their physical appearance, and it's none of his business about whether you mix with the other people in your class. He sounds like a stupid insecure little man who's trying to gain respect in the class by getting in with the "cool" crowd and distancing himself from the others. Just ignore the little blighter; he's not worth your time.
And as for no one laughing at your joke - again, that's not your problem. It probably would have worked if the people in the class had known you a bit better, if they had known that you're not materialistic or anything. But don't feel bad about that; it's got nothing to do with you or them, just that you were working on the assumption that they knew you weren't serious.
You're not a loser - simple! Enjoy the friends you have, be friendly to the people in your class, and be civil to the people you can't stand, and no one will fault you. Yes, everyone goes through phases of thinking they suck a bit, but it doesn't mean it's true.
Good luck!
xxx