I was binge-watching THE WIRE recently, but the theme song "Way Down in the Hole," kept causing my mind to wander to theological questions.
The lyrics end as follows,
"Don't pay heed to temptation, for his hands are so cold,
"You gotta help me keep the devil, Way down in the hole."
Within post-biblical Christian theology, the role of the devil in cosmology is very ambiguous. Is he a servant of God, or is he an adversary? Is he sort of a frenemy?
If, with Dante, you see Satan chiefly as a prison warden of hell, then Satan would seem to be a servant of God. He rules over a "kingdom" only in the sense that a warden does. He superintends the punishment that the higher authority has decided should be meted out. God is the Governor and the legislature, the judges and juries, all in one Being. Satan is the humble obedient prison warden.
Yet Satan's presence there too is a punishment. The "warden" analogy falters here. You can suppose that for a particular warden the job is a punishment. You can write a drama in which a once-promising young man, once a law clerk to a prominent judge perhaps, dreaming plausibly of a high judicial position for himself, makes a terrible mis-step that ends up with his assignment as warden of a prison as a career dead end.
Still, you could also write a drama in which a warden is somebody who wanted to be a warden, who perhaps idealistically believed he could help lower recidivism, see that valuable skills are taught to down-and-out criminals, etc. So he got into a correctional career and the job of warden was the crowning conclusion of that career.
The analogy really doesn't help us place Satan.
On the whole, as the song suggests, the general view is that the devil serves a valuable purpose in the divine economy so long as he is where he is supposed to be, "down in the hole," but that he could be a dangerous adversary -- if not of God, at least of the godly -- were he to escape.