There are numerous theories as to why Hamlet hesitated in killing King Claudius. For example, Doctor Sigmund Freud states that Hamlet's delay in killing Claudius was related to Hamlet's Oedipal urges that dated back to his own childhood.
Freud theorizes that King Claudius represented Hamlet's personal childhood Oedipal fantasies, which Hamlet had forced himself to ignore through repression. Because King Claudius was the embodiment of this internal struggle, it was difficult for Hamlet to kill him. The constant battle between Hamlet's Oedipal urges and his own self-loathing for having those urges led to Hamlet's hesitation. It would have been equivalent to killing that repressed aspect of himself.