Moreover, I do not see the force of that argument, which we are wont to make use of, that God, in order to save men, was bound, as it were, to try a contest with the devil in justice, before he did in strength, so that, when the devil should put to death that being in whom there was nothing worthy of death [i.e., Jesus], and who was God, he should justly lose his power over sinners; and that, if it were not so, God would have used undue force against the devil, since the devil had a rightful ownership of man, for the devil had not seized man with violence, but man had freely surrendered to him. It is true that this might well enough be said, if the devil or man belonged to any other being than God, or were in the power of any but God. But since neither the devil nor man belong to any but God, and neither can exist without the exertion of Divine power, what cause ought God to try with his own creature (de suo, in suo), or what should he do but punish his servant, who had seduced his fellow-servant to desert their common Lord and come over to himself; who, a traitor, had taken to himself a fugitive; a thief, who had taken to himself a fellow-thief, with what he had stolen from his Lord. For when one was stolen from his Lord by the persuasions of the other, both were thieves.Anselm describes an argument that states that humanity belonged to the devil because humanity voluntarily placed itself in the devil's service. The devil, therefore, owned humanity. God could not violate this right, so God sent Jesus into the world to trick the devil into having him killed unjustly (since Jesus was free from sin and divine). By this act, the devil would lose his right to humanity.
The obvious objection to this is that God owns both humanity and the devil, since they exist only at God's pleasure. The devil is only a fellow-servant with humanity. It would not, therefore, be unjust of God to "snatch" humanity from the hands of the devil.
Then he makes an even more interesting argument:
For man merited punishment, and there was no more suitable way for him to be punished than by that being to whom he had given his consent to sin. But the infliction of punishment was nothing meritorious in the devil; on the other hand, he was even more unrighteous in this, because he had not led to it by a love of justice, but urged on by a malicious impulse. For he did not do this at the command of God, but God's inconceivable wisdom, which happily controls even wickedness, permitted it.Anselm assumes that humanity's sin is punished by the devil (in this life? in hell? both?); whether that is true I leave to the side. The punishment, however, is justly deserved by humanity. Nevertheless that does not mean the devil is doing a praiseworthy thing. He does not torment humanity out of a desire to obey God, but out of his own malice. God is leaving the fellow-servants to themselves - and that is punishment enough.
As I read this I was reminded of Saruman and Wormtongue in The Lord of the Rings. Wormtongue voluntarily placed himself in the service of Saruman, to aid in the destruction of Theoden. After his restoration Theoden offers a way of redemption to Wormtongue: ride to battle with him and prove his loyalty. Wormtongue refuses and flees to Saruman. After the battle at Helm's Deep Gandalf confronts Saruman and Wormtongue at Isengard, where they are both offered a path to redemption. They both refuse. Gandalf says, "Small comfort will those two have in their companionship: they will gnaw one another with words. But the punishment is just. If Wormtongue ever comes out of Orthanc alive, it will be more than he deserves." Wormtongue deserves his punishment but that does not mean Saruman is a force for good in administering it. They will be a misery to each other.
This is further illustrated by the saying of Jesus in Matthew 18:7: "Woe unto the world because of offences! for it must needs be that offences come; but woe to that man by whom the offence cometh!" Some evils may be necessary or just but that does not make the instrument of evil blessed, e.g., Judas Iscariot.
In several biblical texts we are warned that sin is its own punishment. Paul says in Romans 1 that God punishes some by leaving them to their own sin, allowing it to work itself out in their lives. Again, an evil does not become a good simply because it is used as the means to a good.
We can't know whether any one occurrence is actually the judgment of God upon any particular sin. Evil things happen to both "good" and "bad" people. But even if we could we do not need to celebrate that occurrence or pretend that it isn't an evil. Our reaction to all evils should conform to the words of Jesus in Luke 13:
Suppose ye that these Galilaeans were sinners above all the Galilaeans, because they suffered such things? I tell you, Nay: but, except ye repent, ye shall all likewise perish. Or those eighteen, upon whom the tower in Siloam fell, and slew them, think ye that they were sinners above all men that dwelt in Jerusalem? I tell you, Nay: but, except ye repent, ye shall all likewise perish.