If Dumbledore is the most powerful wizard (allegedly), why would he work at a glorified boarding school? Is there a role with more responsibility?
He did not trust himself to have more power
As a young man, Dumbledore was tempted by the idea of power over others. It’s how he was drawn in by Grindelwald’s anti-Muggle beliefs (that and his romantic infatuation with Grindelwald, I suppose). As such, he felt it was too dangerous for him to be in a position of responsibility in the magical community:
“Years passed. There were rumors about him. They said he had procured a wand of immense power. I, meanwhile, was offered the post of Minister of Magic, not once, but several times. Naturally, I refused. I had learned that I was not to be trusted with power.”
“But you’d have been better, much better, than Fudge or Scrimgeour!” burst out Harry.
“Would I?” asked Dumbledore heavily. “I am not so sure. I had proven, as a very young man, that power was my weakness and my temptation. It is a curious thing, Harry, but perhaps those who are best suited to power are those who have never sought it. Those who, like you, have leadership thrust upon them, and take up the mantle because they must, and find to their own surprise that they wear it well.
“I was safer at Hogwarts. I think I was a good teacher—”
Harry Potter and the Deathly Hallows
He may also have viewed it as a high calling
He also seems to view it as one of the most important things a talented wizard can do:
“I am surprised you have remained here so long,” said Voldemort after a short pause. “I always wondered why a wizard such as yourself never wished to leave school.”
“Well,” said Dumbledore, still smiling, “to a wizard such as myself, there can be nothing more important than passing on ancient skills, helping hone young minds. If I remember correctly, you once saw the attraction of teaching too.”
Harry Potter and the Half-Blood Prince
Of course, he’s talking about a sensitive subject here, and to Lord Voldemort no less, so it is possible he is not being entirely honest. Nonetheless, few roles could be a greater responsibility than having to care, for the better part of each year, for a generation of Britain’s young witches and wizards: ensuring their education, protecting them from Dark Magic, and various other duties.
You have to ask yourself what else he might do which would be better....
As headmaster of Hogwarts he has a level of respect comparable to any of the Ministers of Magic that we see, indeed we are told in the books that Fudge frequently sought his advice before they became estranged over the return of Voldemort.
Also from what we see of Dumbledore throughout the books it seems that one of his greatest interests is knowledge rather than political power as such. Even when he was young his approach to gaining power was through researching the Hallows rather than cultivating a political influence and again when Voldemort reappears his strategy is to try to learn as much about him and his early life as he can.
Even when he is leading the Order of the Phoenix he is always somewhat in the background and although he clearly commands the total respect of the members we never really see him taking a front and center leadership role.
In terms of his career, we never hear about any sort of magical universities so, for an academic teaching at Hogwarts is probably a pretty good job. Bearing in mind that it is also one of the oldest and most significant magical sites in Europe both in terms of the institution and the building itself, consider the Room of Requirement, the Chamber of Secrets, the Sword of Gryffindor as well as the extensive Library and practical facilities as well as working with some of the best practitioners of magic in Britain. E.g. Snape and McGonagall are both highly skilled in their fields (proved by their brewing of the Wolfsbane Potion and Animagus status respectively).
So for someone who is passionate about researching magic Hogwarts castle seems like pretty good place to be and is analogous to being a professor at a top university.
There is also the fact that as far as we know he has no children or other family, apart from his brother, who he has a strained relationship with and in any case lives within walking distance so you could certainly argue that Hogwarts is a surrogate family for him, while at the same time one that allows him to maintain a certain amount of emotional distance from. Even with Harry his emotional relationship is always on his terms.
Also consider that within the realms of Hogwarts he arguably has more power than the minister or Magic as he is essentially the absolute ruler with a level of control over the daily lives of staff and pupils that no Minister would have.
Bear in mind also that he spends most of his time in a heavily fortified office accessible only retractable stairs operated by password.
Is there a role with more responsibility?
Why would he need any? Sure, sometimes you have to accept some responsibility in exchange for power, but that system can be gamed.
If he's posing as a senile-ish headmaster and delegates all the boring stuff to his underlings then he has, like, 0 responsibility while also enjoying perks of all power that comes with his position.
Just think about it: he has authority over nation's all future wizards during their teens, when they are still malleable and inexperienced. He gets first ability-informed pick and he can influence his students en masse.
Don't like competitors? Embrace and sustain opinion that desire to achieve one's goals is bad so people will lterally want to get to any house but troubling one (which will be hence stuffed with morons and leftovers).
Need henchmen? Embrace and sustain opinion that paving road to someone's goals with your and your friends' bodies is a virtue. Hell, you wouldn't even need to pay those.
Promising student gets bullied? Well, if he asks for help, his problems will be solved. Of course, he'll owe you one afterwards.
One of your people needs an apprentice? Well, you can arrange some promising student that looks like he would fit to talk to the guy - before the student gets head-hunted by competitors.
Thus, Dumbledore can ensure that he has enough loyal people in Ministry and in any other place he's interested in (provided that he's willing to wait some years while plans unfold). He has people willing to wage war on his enemies - and he does not have to intimidate or bribe them so they'll keep fighting!
However, the main part is: accountability, or lack of it.
No more stupid blunders like bad PR from your minions going overboard with sacrifices.
Dumbledore is not held accountable neither for actions of his minions, nor for his own.
Just imagine: Ministry gets its hands on Philosopher's stone. However, instead of funding efforts to mass-produce those and Elixir of Life, they simply hide it somewhere and refuse to share because Minister thinks that death is fun - an this continues for unspecified number of years while people are dying.
Compare with: Dumbledore gets his hands on Philosopher's stone. However, instead of funding efforts to mass-produce those and Elixir of Life, he simply hides it somewhere and refuses to share because Dumbledore thinks that death is fun - an this continues for unspecified number of years while people are dying.
Minister would be held accountable for that eventually whereas Dumbledore would not. That's the main perk of Dumbledore's position: lots of power with zero responsibility.
In very generic terms, some people (quite a lot, actually), decide to stay at a job they like and are good at, even when other opportunities come along. Some people value being in a a place where they feel useful rather than seeking power for its own sake. I'm not a Harry Potter fan, but it just seemed to me that the question has a hint of intellectual snobbery.