After Hamlet kills Polonius, Claudius decides to take the matter into his own hands rather than involving a legal process (which did not even exist as it does today). As prince, Hamlet lives in a space that is kind of outside the law. Additionally, Claudius wants to permanently get rid of Hamlet while making it seem to the public (and Gertrude) that he is trying to do the best for Hamlet.