Shakespeare allowed Claudius to present a soliloquy to show Claudius' rationality and his understanding of the actions and consequences he provoked.
We can arrive at this answer because:
Sin makes Claudius feel estranged from God. He wants to ask for forgiveness, but he knows he is not sorry, and therefore, God will not hear him. In this case, the soliloquy is what allows Claudius to express the guilt he has, even though he is happy with the result of his actions.
More information on what is a complex character at the link:
https://brainly.com/question/4768932