This is an interesting comparison...I have found Hamlet to be more than a little cluttered and strange. This could be, in part, attributable to the fact that it is not entirely original. It's something of a re-write according to T.S. Eliot and the choices as to what to leave in, what to take out, and what to tweak from the original may lead to some of the opacities in the play. (These particular oddities do not exist in Macbeth and Lear...)
I do give Hamlet full credit for presenting us with a difficult moral dilemma. When Hamlet takes revenge on his uncle he is also, by default, taking revenge on his mother. This disturbs him and, to me, is reminiscent of some Greek tragedies.
The story of Hamlet is not unlike the story of Agammemnon and his children. When Clytemnestra kills her husband Agammemnon and takes on a new husband, the children decide to take revenge against both murderers.
They are compelled to exact vengence but commit a rather reprehensible crime when they kill their mother. This leads to severe punishment from the Furies and the children are condemned.
Sartre re-wrote this story as The Flies and presented an argument that the children could only be found guilty of injustice if they accepted guilt for killing their mother. If they acted out of a pure sense of justice, they should not be considered guilty and should not think of themselves as criminals.
Hamlet plays both sides of this moral dilemma. This does not lead to a moral ambiguity, exactly, but to a complex situation where "you're damned if you do and damned if you don't". Hamlet is caught between two forms of guilt, one of action and one of inaction, necessarily bound to betray one of his parents.