The Legions of Hell are usually portrayed as enemies of God, the Council of Angels, and everything that is good and true. Their existence is a bad thing for almost everybody; when they come out of Hell, they're doing it to break things and make the world a worse place. And, you know, corrupting people into evil and tormenting damned souls is usually a pretty nasty thing to do.
But sometimes, the demons are that way for a reason, and they're doing it with the express approval of the Big Guy Upstairs. They still torture and corrupt people, but the corruption and torture are portrayed as serving a necessary function in the grand scheme of things. When they attempt to corrupt humans, they're doing it as a way of testing humanity's faith, morality or both. When they torment the souls of the damned, it's because the damned deserve punishment and someone has to deliver it.
This trope is Older Than Feudalism, and in fact predates the current conception of Satan serving as God's enemy. In the Hebrew Bible, Satan or Sammael was in fact an angel, whose duty was to test man and attempt to lead him into evil, as well as to destroy humans at God's command; in the transition to Christianity, the Devil morphed into a rebel against God and a being of pure evil.
A common subversion, or perhaps deconstruction, occurs when this trope is how the cosmos is supposed to work, but due to corruption, apathy, or a simple breakdown in communication, Heaven and Hell are in an adversarial relationship, to the detriment of a properly-functioning cosmos. Sometimes, the plot will even revolve around finding out what has gone wrong and fixing the situation.
This trope can overlap with Dark Is Not Evil, but not always. Sometimes Blue and Orange Morality is in play, sometimes God Is Evil, and sometimes, just serving a divine purpose doesn't exempt demons from being sadistic jerks.
No relation to Hells Angels.
- Angels of Hell (see "Myths & Religion") appear in a book of the The Sandman continuum, where Lucifer tires of running Hell and, to fill the void, God sends two righteous Holy Angels down to take over and ensure things are running properly. The two Angels, out of a combination of self-righteousness and Jerkassery, end up making Hell a never-before-seen place of pitiless and unmitigated horror and suffering, convinced this is necessary to fulfil God's will...
- Discussed in Immortal Hulk, which compares and contrasts this trope with its counterpart, the devil as adversary of Heaven - the difference between the accuser in Heaven's service who scours and tests mortals (as with Satan in the Book of Job) and the adversary who seeks to destroy what God has created.
- A character in Jacob's Ladder (who is heavily implied to be an angel) explains that the entities in the film that appear demonic tormentors are actually angels trying to cleanse the souls of the damned that they may eventually ascend to heaven.
- Downplayed in Little Nicky. Satan rules hell mostly because someone has to see to it that evil souls are punished, and he's simply the guy who's most suited for the job. His older sons Cassius and Adrian are evil to the core, however. His youngest son, Nicky? Not so much.
- The demons in Dark Angel: The Ascent are religious, and Hell is indicated to be working in concert with Heaven. They're not evil, just Punch Clock Villains.
- Incarnations of Immortality features the failed version. Supposedly, Satan is corrupting people and manipulating souls for the purpose of self-aggrandizement, while God is not minding the store, leaving the other Incarnations to fight against Satan's plots. In his own book, however, Satan is portrayed as a Punch-Clock Villain who has gotten tired of the system's breakdown, and is plotting a takeover so that he can update the system's definitions of Good and Evil, and stop souls who are supposed to go to Heaven from ending up in Hell. After the Incarnations defeat Satan's final plot, God is fired, Satan chooses God's replacement, and the system starts working again.
- In The Aeneid, the infernal Furies are sent away from their work in the Underworld by Juno, goddess of the heavens. She uses them to start a war between Aeneas and Turnus to delay Aeneas' fated victory, an unnatural plan that earns Juno Jupiter's reprimand.
- In The Divine Comedy, Virgil trusts the devils of fraud because his paganism has taught him that demons are agents of the gods' justice. The trope is Subverted when the Malebranche try to kill Virgil and his ward after lying to them about how to leave their torture-chamber. It's so foolish to think Fallen Angels would act justly that even a damned Hypocrite mocks Virgil for his blunder.
- In The Metamorphoses, the Furies, Harpies, and other cthonic monsters Orpheus charms are agents of justice imposing punishment on wicked men. They may be intimidating, but they punish those who offend the gods and are not themselces tortured like Christian devils.
- In Perelandra, Ransom mistakes the horrible insects below the Underworld for demons, only to realize that the creatures below the ground are just as much a part of God's creation as those on the surface. He appreciates the pagans for honoring these cthonic beasts and not falling into the pantheism of the real demons.
- In Isaac Asimov's "The Last Trump", the angel responsible for Earth is very much surprised to learn that the Devil is God's servant, since Good requires Evil to struggle against.
- The Book of Job in The Bible is the Trope Maker, where ha-satan ("The Accuser") is a member of God's divine council. When God points out Job as a righteous and virtuous man who has never turned away from Him, Satan responds that of course Job is a loyal servant of God; he has everything he could possibly want, and if he lost all of that, he would curse God and turn away from him. God agrees that Satan may put his claim to the test.
- Inverted in Islamic texts, where there exist angels of Hell. Their job is to prepare the fires of hell and later punish sinners.
- A quote attributed to Martin Luther, popular in some sects of Reformed Protestant Christianity, says, "Even the devil is God's devil." The point is not that The Devil is necessarily on the same side as God, but that God is The Omnipotent and therefore everything that exists, even the Devil, ultimately works according to God's plan. (Trying to describe how exactly this works in practice, though, has been the subject of much theological Serious Business.)
- The servants of Yama the Just in Hinduism take no pleasure in the torments they put sinners through in hell/naraka, but they do it because it must be done.
- In Ars Magica, this is one theory about why demons do what they do; even though they appear to be enemies of God, they are actually about God's work. The Avengers of Evil in particular claim to be about this, and they can make a fairly good case that they're telling the truth...but no one can ever be sure, since a demon's very nature is to deceive.
- Dungeons & Dragons:
- Supplemental sourcebook Tyrants of the Nine Hells proposes the theory that the Lawful Evil Devils are angels who were created by the heavens for the purpose of battling the Chaotic Evil Demons, and who took on some of the fierce and terrible traits of the Demons to better understand how to combat them. This caused the other angels and gods to shun them and eventually led to the Devils being granted (or possibly being exiled to) the realm of Baator the Nine Hells to ensure the conflict was kept away from the other realms of Law. Keep in mind that this is the version of events that's supposedly told by Asmodeus himself.
- Implied in the Forgotten Realms setting: the devils/baatezu have contracts with the god of the dead (currently the Lawful Neutral Kelemvor) that allow them to recruit unclaimed dead souls from the Fugue Plane (where the dead are sorted). Exactly what the gods get out of it is not explained, but it contrasts sharply with the demons/tana'ri, who occasionally mount raids on the Fugue Plane and simply kidnap the souls they want.
- In In Nomine, the Habbalah claim to be this; they live in Hell and are demons, but they believe that they're angels working where God needs them most, and that God has given them free license to punish sinners (and every human's a sinner, of course). Canonically, they're even more deluded than most demons.
- Vampire: The Requiem has a faction called the Lancea Sanctum. They're a group of vampires who believe that though they are damned and possessed by the demon-like Beast which drives them to evil acts, they are meant by God to scare and punish humanity through their depredations so they remain virtuous. This is, to say the least, hotly contested since it functionally pushes them to seek ways to harm humanity actively, albeit with more focus on the wrongdoing. Their mythology even tells of visitations by disapproving Angels when vampires fail to live "up" to their role.
- Part of the basis for the Lancea Sanctum is the Path of Night from Vampire: The Masquerade, a Path of Enlightenment which believes a vampire's purpose is to serve as an agent of evil in the service of the Powers That Be, tempting and horrifying mortals in order to test them, the weak falling and the strong tempered by their trials.
- Kindred of the East features the Howl of the Devil-Tiger dharma, who believe their role is to serve as replacements for the corrupt Yama Kings as devils in the service of Heaven. On the one hand, they are to punish (and make use of) humanity's greatest sinners; on the other, they are expected to act as befits their station in the Celestial Order, behaving as truly cultured and magnificent devils should.
- In Afterlife, you need demons to run Hell just as much as you need angels in Heaven. Shortages will result in souls not being punished efficiently. However, too many unemployed angels or demons will get bored and eventually declare war on the opposing astral plane.
- Princess Maker 2's Prince of Darkness, Lucifon, is an example of this trope. In the very beginning of the game, the LORD tells him to attack the corrupt and decadent human kingdom and punish it for its sins. He accepted the LORD's will and attacked humanity, only to be defeated by an unknown warrior. In a discussion after the battle, he tells the warrior that he was Just Following Orders and "I killed only fools," a statement that the warrior has no answer to.
- Shin Megami Tensei has used this trope on occasion. Note that unlike most examples of this trope, God Is Evil in this setting.
- Shin Megami Tensei I mentions it in passing in the Chaos Ending, where Lucifer says that he himself is also a part of YHVH.
- In Shin Megami Tensei II, Satan is YHVH's Dragon and the most powerful demon of Law. On the Law path, he finally gets fed up with YHVH's bullshit and joins Aleph to take his boss down.
- This is actually pretty close to how Satan and Hell are portrayed on South Park. Satan is actually one of the more level-headed characters in the entire show, and he sees the tormenting of sinners as just a job he does. Then again, it's also shown that, in the South Park universe, everyone goes to Hell except for Mormons. Even though God is a Buddhist.