Why do shows always make fun of intelligence and talent?

I’ve been wondering for quite some time now why the smart person is often depicted as a social outcast, regardless of the show in question.

I picked 3 characters who fit the profile for this query, as they have similar traits:

All three of these characters are intelligent and physically talented (either dancers or martial artists, sometimes both).
And they’re either depicted as nerds or social outcasts in their respective shows (again, sometimes both).

Is there some reason this kind of character can never be the cool/popular person?