We (by which I mean Americans generally, but it’s true of all English-speaking countries to an extant, I suspect) live in a culture which, for the most part, doesn’t like smart people. Smart people are variously considered freakshows, emotional cripples with no social skills, or scheming bastards doing all sorts of devious who-knows-what while simple, honest, hard-working folk just try to get by. Even a movie like 2013 had “weirdo Dr. Chandra creeping out a spaceship full of working-joe astronauts.”
This anti-intellectual, anti-rational streak varies from dismissive comments to outright mania, depending on the context and the mood of the day. The scientist-hero had a brief shining moment in the ’50s and ’60s during the space age, but that eventually faded, relegating the “brainiac” to a support character as “the punching guy” ascended.
(Heck, look at the Star Trek reboot. A show that was once about scientists, engineers, and explorers, using technology and concepts mostly-extrapolated from real science , has been reduced to a hyperkinetic lightshow punctuated by fistfights. Way to go, culture.)
If you are a smart person disinclined to punch people, this tends to leave you short of reader-identification characters, and the characters that do exist have to give you something to latch on to.
This is where the Smug Genius comes in. The Smug Genius has been around for ages; the earliest one who comes immediately to my mind is Daedalus, the guy who created the minotaur’s labyrinth and built wings for himself and his son to escape Crete.
The archetypal Smug Genius of modern times is of course Sherlock Holmes, who set the pattern for Tony Stark, The Doctor, Dirk Gently, Batman, Chris Knight from Real Genius, and so many others. (I note that Smug Geniuses all seem to be guys… Velma or Twilight Sparkle are certainly geniuses, for instance, but they’re not smug about it.) The Smug Genius is not only the smartest guy in the room, he wants to make sure you know it, and he’s always, always way ahead of everyone else.
What is the appeal of the Smug Genius? Honestly, I think, it boils down to confidence.
Smart people, as a group, are often not very self-confident. Why would they be? Besides the already-mentioned “nobody likes smart people” strain of our culture, they’re constantly being praised by teachers and parents for doing so very well on tests, which come easy to them, setting them up with Impostor Syndrome.
Unlike the real smart person, who is still quite fallible and able to make mistakes (leading to comments like “And you think you’re so smart!”), the Smug Genius is never wrong, is never an impostor, and if not liked for their smartness, is at least respected and gains social capital from it. That’s naturally a very compelling thing for somebody who’s got nothing going for them except the ability to take tests well.
PS: Note that the Bill Gateses and Steve Jobses of the world, while financially very successful, are still generally not liked very much. Basically someone said to them, “If you’re so smart, why aren’t you RICH?” And they took that to heart.
 Except the transporter. That was always bunk. But it was required because flying around in shuttlecraft all the time would break the budget.