Just like other aspects of learning, socialising is trickier for some kids than others.
I liken it to the way some kids are naturally good at reading or maths...and others need extra time and advice to get up to speed.
I have two DC who both found socialising easy. They've both attended and still attend quite small schools where the parents have always been friendly and shared our issues.
What I've learned from watching and helping with children who found socialising harder is a number of things...
They're not always easy to hear...for you I mean. Because obviously, your son has the lovely qualities you mentioned...such as being caring and funny and bright.
But when it comes to the complex social rules which children live by, these attributes aren't always enough.
There are 'accepted' forms of communication and complicated hierachies which some children can naturally seem to pick up...these are the children who find making friends easier.
Now is a particularly awkward time for kids...it's not like he can go to clubs and activities outside school....the best advice I can give is to talk to him about friendships and find out where he thinks he might be going wrong.
Genuinely listen to him...what might sound like something silly to us is actually deeply important to children.
For example, there was a little girl in DD's class when they were about 9 and this little girl just could not fit in. The others kept rejecting her.
Her Mum had been bullied in school and she told me that she was very depressed about the situation so I told my DD we were having her round for tea one day and I watched them play with another local child.
The little girl's issue was that she was coming over as boastful and bossy...now she didn't know that...in her mind she was just sharing the things she was proud of and also trying to take a leading hand in the games.
But she lacked finesse...she didn't understand how to share leadership or discuss the rules of a game and include others.
So I was honest with her Mother and her Mother could then focus on helping her to play more effectively.
I'm not saying I am personally responsible for this child's progress by now they're all 12 and she is MUCH better socially. She matured a lot and is more able to relax.
Does your son give any reason for the rejection? Are the other kids saying anything?