Hamlet, in Shakespeare's Hamlet, tells you himself why he hesitates to kill Claudius:
Now might I do it pat, now 'a is a-praying,
And now I'll do't--and so 'a goes to heaven,
And so am I revenged. That would be scanned [looked at or thought about again].
A villain kills my father, and for that,
I, his sole son, do this same villain send
Why, this is hire and salary, not revenge. (Act 3.4.73-79)
Hamlet's Catholic beliefs suggest that if Claudius dies just after he's confessed, he will be forgiven of all of his sins and he will go to heaven. Hamlet doesn't want to send Claudius to heaven.
Hamlet's father, in the form of the Ghost, is lingering in a purgatory-like state, and Hamlet, if he were to kill a king, may go straight to hell. Thus, Hamlet reasons, Claudius, the evil one of the three, will be the only one of the three to be rewarded with eternal salvation if he kills Claudius while he is confessing.
Ironically, Claudius, while he is praying, is not really confessing. He...
(The entire section contains 3 answers and 825 words.)