Right when he is ready to murder Claudius to avenge his father's death, Hamlet witnesses Claudius making his mea culpa (acknowledgement of guilt). Although Hamlet thinks his uncle is under grace at this moment, Claudius realizes that he has not really repented for as much. He understands that his words are merely "lip service" to go through the act of confession, but that his heart is not really in it. By this, one can understand that although Claudius is revulsed by his acts, he is nevertheless glad to benefit from the consequences thereof: he has his brother's wife Gertrude now as his own, and he is king in his stead.
How can one honestly 'be sorry' and 'be glad' at the same time? Claudius at least sees the absurdity of the situation and the hypocrisy of such pretention.
Ironically, Hamlet does not follow through with his plan to kill Claudius at this point, thinking that Claudius will die forgiven and expiated for his sins. This scene is pivotal, for if Hamlet had indeed killed his uncle at this point, he would have had his vengeance and the horrible bloodbath which ensues would have been avoided.