In the play "Hamlet", there are many recurring themes. One of the central themes of the play is attaining salvation, a goal which many of the characters hope to achieve. The after life and the hopes of being accepted into heaven were of utmost importance to the people of Hamlet's time. If one died with a venial sin (a "minor" sin such as stealing or lying), on their soul, they would be destined to spend a period of time in purgatory as punishment. If the sin was a mortal one (such as murder), without forgiveness, the persons soul was doomed to eternal hell.
Although Claudius believes that prayer has the power to forgive those who have plummeted into a life of sin, he knows that he himself is unable to ask for forgiveness. Claudius murdered Hamlet's father, and thus can not be forgiven. He has also denied Hamlet's father the opportunity to pray for his own salvation (the king could not go to heaven without absolution) before he was killed.
Claudius realizes that he has committed a mortal sin and therefore, in a twisted way of thinking, decides he might as well finish what he started (by also killing Prince Hamlet) and further his errant ways.
At one point in the play, Hamlet walks in on Claudius praying. Hamlet originally intended on killing him at this point, but spares Claudius' life because he assumes that he is praying for forgiveness (which he is not). If Hamlet was to kill Claudius while he was repenting, Claudius' soul would go straight to heaven. Instead, Hamlet decides to try to catch Claudius off guard while is unrepentant and has sin on his soul. By doing so, Claudius will either be sentenced to a certain amount of time in purgatory, or a...