Why is it that Hamlet's uncle killed his father in Shakespeare's Hamlet?
There are two possible motives for Claudius killing King Hamlet (Hamlet's father). The first would be to access to the throne of Denmark; the second to take Gertrude, the queen, for his wife. It is likely that Claudius' passion for both prizes was his driving force. His greatest folly was perhaps the speed at which Claudius took on the accession to both roles, as he says himself in his primary speech -
Though yet of Hamlet our dear brother's death
The memory be green,
As can be seen in Claudius' detailed instructions in Act 1 Scene II, he has usurped the role of king fully, in terms of his marriage to Gertrude-
our sometime sister, now our queen,
and of his involvement in the political affairs of Denmark-
To our most valiant brother. So much for him.
Now for ourself, and for this time of meeting.
Thus much the business is:
Claudius' speed and enthusiasm for each of the roles he has taken by the murderer of King Hamlet make both the spirit of the dead king, and his tormented son, seek revenge.
What's so interesting is that what you ask is an open question. No motive is ever given for the murder, not in the words in the conversations in the play or in the soliloquies. Moreover, the Ghost never even mentions any reason for Claudius to do what he did. It's easy to speculate about jealousy, sibling rivalry, lust for his sister-in-law, and so on, but there isn't even a suggestion of a motive.
One can't help but think that this is Shakespeare's intention; to suggest that murder never has a good reason. A self-centered murderous and tyrannical spirit is to blame, no matter what specific motive one may assign to it.
The Ghost put it pretty perfectly:
Murder most foul, as in the best it is;
But this most foul, strange, and unnatural.
There's no explanation that would make any sense.
In Shakespeare's Hamlet, Claudius kills King Hamlet, Hamlet's father, so he can marry his wife and be crowned king of Denmark.
Hamlet was the rightful heir to the throne, but when Claudius marries Queen Gertrude, he becomes king.
Though it was considered incest for a man to marry his dead brother's widow, Claudius apparently sufficiently woos Gertrude and succeeds in getting her to marry him. When the play opens, Hamlet, of course, is upset at Claudius for marrying his mother and usurping his thrown. Until he speaks to the Ghost, however, Hamlet doesn't suspect that Claudius also murdered his father.