I've been researching this very issue for a while. I just finished the first draft of the novel I'm writing where this is important.
In places where there are a lot of magicians, maybe they do rule
There is a lot of fiction about magical kingdoms (not including Disney). For example, typical Elven kingdoms were ruled by powerful magicians, with magic replacing technology and even bending time (going into an Elven kingdom for a night and coming out a generation later).
However, there was typically a weakness to their power. Most of the time this was iron. Even putting a small piece of iron at your door would prevent elves from entering in some legends and stories.
Magicians are still mortal
Steven Brust is quoted as saying “No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style.” I believe that this was a quote by Vlad Taltos at a time when he rarely used magic and one of his professions was killing people, often powerful sorcerers.
Where magicians are rare, ruling may be dangerous
In most fantasies, the rulers are mortal and the magicians are advisers at best.
Think on the various versions of the stories about King Arthur and his knights. While there are small places where magicians rule, such as the place where Lancelot grew up in (he was raised by the Lady of the Lake), these places were not a major part of the story.
Usually if a castle was ruled by a magician, this magician was a villain. And usually one of the knights of the round table was good enough to kill them.
The most famous magician in the story was Merlin, who was one of the most, if not the most, powerful magicians in the story. And mostly he was Arthur's adviser, though he occasionally tried to control things from behind the throne. But he never ruled.
Numbers
If magicians are rare, then there may not be enough magical help to rule a kingdom safely. Even if these magicians have a lot of personal power, a revolt by the army or the peasants might be able to kill the magician, even if a lot of them die in the process.
Religion
This is a two-edged sword. It's been talked about in many answers as a counter to the magicians' powers. This is logical and good.
However, if the gods grant power to the magicians, then do they grant them to random people, or do they grant them to some of the better or perhaps more fanatical priests? That might make the churches a place that is ruled by magicians. There could be a church that is ruled by people who actually have been chosen by god and might believe that their personal beliefs are those of the gods. After all, he was chosen by the gods and allowed to channel their powers.
Magicians have better things to do
If you could see the very secrets of the universe, would you be interested in the day-to-day aspects of ruling a kingdom? This has also been used in answers. I also think that such powers might make magicians more careless around mortals, which might leave them vulnerable. Better to just create a tower by magic, wherever you wish, and just live your life, coming out only for more supplies or entertainment.
The belief that mundane lives matter
If these magicians believe that mundane people (those without magic) matter, then they may not want to risk hurting them. And ruling a kingdom will cause them to hurt mundanes. For example, they would probably have to kill people in order to take the kingdom. And they would probably have to kill people to defend it.
And with magical powers might come heightened senses such that they could feel the souls of those who are killed. Or even a mild telepathic connection to nearby humans would be horrifying in the middle of a war.
Learning from mortals
In a sequel to my current novel, two of the most powerful halflings (demigods, powerful magic, near-immortals) are married and are now the king and queen of both courts of the fey. This story is set in the late 1960s in the US. Our king and queen live in a van and are sort-of hippies. This is a more modern version of a magical tower.
They're doing this for a couple of reasons. First, their kingdoms are spread out over the world and this way they can go to where the little people are (sometimes literally). And second, they are learning from the human society without interfering in it. They pretend to be mortal, and only those who know them or can use magic can tell otherwise.
These protagonists believe that human lives matter and don't want to kill people. After all, humans live such short lives...
The magical creatures stay hidden from normal humanity because humans outnumber them. Even my protagonists are cautious about being found out. They are powerful, but they aren't all-powerful. And who wants to be locked up and possibly vivisected for years until somebody makes a mistake or they get help to break out?
God can’t remove wizards' powers once they're bestowed.
- but I suppose a/the god could still easily remove the wizard $\endgroup$