First of all, it helps to understand what he has said about being moral. Here are a few examples from the play, of his moral beliefs. He finds his mother's actions despicable, and bordering on incestuous. So, it is immoral to get married quickly after a spouse dies. Then, he extends that to all women. All women are immoral and fickle. He also broods over his uncle's lack of morality, calling him a monster. He has a strong sense of heaven and hell; he won't kill his uncle while he's praying, because then he might go to heaven, not hell. He himself doesn't want to kill his uncle without being assured that he is guilty; he doesn't want to commit murder lightly, so that reflects a certain morality.
Hamlet's morality often keeps him from acting; it makes him mull around in his uncertainty and angst, instead of just acting. If he wasn't so morally concerned about heaven and hell, he could just go kill his uncle, at any time, without fear of repercussions. If he wasn't so morally concerned about proper behavior in women, he wouldn't be so angry about his mother, leading to his rejection of Ophelia. His morality contributes to keeping him angry and inactive throughout the entire play. He is just full of words and haughty sentiments, but when it comes to putting his actions where his words are, he often backs down, attributing it to morals. Is it morals, or cowardice? I hope that those thoughts help a bit; good luck with the question!
As he states himself, Hamlet remains "Within the book and volume of [his] brain" (I,v,103). His great melancholy causes him to not act, but rather to engage in self-debate. While he ponders regicide, he also worries that if he kills Claudius and Claudius has not, in fact, murdered his father, he then will be executed. Also, Hamlet is torn between his loathing and his love for his mother.
When he does act later in the play, he acts rashly and wrongly. He slays Polonius whom he mistakes for Claudius and he turns his wrath against his mother onto another woman, Ophelia. These mistaken actions cause Hamlet to become more depressed and ambivalent about what course of to take. Certainly, Hamlet is a man of morality--he fears punishment after death--but he does take some action, albeit misdirected and not of the worldly magnitude that avenging his father's death would be.