Hamlet didn't really have proof of the crime. The truth is, the fact that Claudius is guilty was not enough to justify what he did. Executing someone, if something should come down to this, should be a perfectly informed decision beyond any reasonable doubt of guilt. Hamlet makes a scene in the play in order to extract a reaction from Claudius, but it even if he was sure, it doesn't mean that he had any actual proof.