Much of Hamlet's moral dilemma is based on the morality and immorality of revenge.
Hamlet is definitely a Christian. He has been raised to not take personal revenge: turn the other cheek and love your enemies.
Along comes his father's Ghost who turns Old Testament on his son, saying revenge me, an eye for an eye, blood vengeance.
Hamlet is morally very confused. Does he trust his father or heavenly father? Which heavenly father does he trust, Old Testament Yahweh or New Testament Jesus Christ?
Much of Hamlet's indecision in the play comes from moral confusion. Hamlet knows that committing the act of revenge will send him to hell. His famous "To be or not to be" monologue might very well be his pondering of whether or not to damn himself: "To be damned or not to be damned..."
Hamlet cannot kill Claudius at prayer: that would send his soul to heaven. So, he waits until it is proved that Claudius is a murderer (he poisons the cup that Gertrude drinks) before he takes action. Hamlet waits until he has already been morally wounded. In the end, Hamlet only commits revenge after he has been a victim of it. In this way, Hamlet wants to first send Claudius to hell, himself and his father's Ghost to heaven.