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 lifetime in hell, depending upon how major his sins are at the time. Hamlet wants to make sure Claudius is unrepentant at the time of his death, so that just like his father, Claudius will not be at rest in the after life.
For some, Hamlet's intention towards Claudius was too horrible to contemplate. This view was