From the question, it appears that Hamlet's madness is taken for granted. Although it is true that he is dubbed "mad" by his mother, for example, there is no actual evidence that he has actually lost his mind.
In fact, Hamlet pretends to be mad in order to carry out a number of actions that would be severely punished if he performed them as a sane man. The "method in his madness" mentioned by Polonius should alert us to Hamlet's pretense. For all the talk about his "inaction," Hamlet is quite an active character.
He is indeed severely shaken by the loss of his father, his mother's hasty marriage to his uncle, and the revelation that his father was treacherously murdered by his mother's new husband. You could argue that seeing and conferring with a ghost is a sign of madness. But Horatio was the first to see it, and no one doubts his sanity. Moreover, in Shakespeare's times people tended to believe in the supernatural. A 16th century audience would not have thought that this alone was a proof of madness.
From a modern psychological point of view, the word "madness" is not even a clinical condition. One could say that Hamlet's grief led him to behave erratically, that he had a serious conflict with women in general and with his mother in particular, that his father's mandate weighed heavily on him, and that his bouts of violence -both physical and verbal- were defensive displacements to postpone fulfulling the mandate.
It cannot be denied that some pathology could be diagnosed on close examination of Hamlet's behavior throughout the play. However, insanity seems to be out of the question. Claudius indirectly contributed to Hamlet's condition through his criminal and scheming ways, but he should not be held accountable for Hamlet's decision to act insane.