Great question! Of course, you might disagree with Fortinbras and his assessment of Hamlet's life at the very end of the play when he enters the stage to take the crown of Denmark. Note what he says about Hamlet, who he finds dead on the floor:
Let four captains
Bear Hamlet, like a soldier, to the stage;
For he was likely, had he been put on,
To have proved most royally: and, for his passage,
The soldiers' music and the rites of war
Speak loudly for him.
Fortinbras thus argues that Hamlet acted "most royally" in how he dealt with the tragic situation that this play explores. On the one hand, we could see the wisdom in this. Hamlet, for most of the play, found himself the subject of a number of different plots, betrayals and stratagems that sought to either kill him or to change his loyalty. The fact that he resisted all of these and managed to die without having compromised his devotion to the truth and to his father speaks of a definite nobility of character. Horatio clearly feels that his role, given to him by Hamlet himself, is to tell of Hamlet's nobility in the way that he sought to confront danger and died avenging his father.
However, at the same time, it is perfectly possible to disagree with such an assessment, and one of the massive critical debates concerning this play touches precisely upon this point. Is Hamlet a good and noble character? He rushes to kill Polonius, shows little grief afterwards, then deliberately organises the death of Rosencrantz and Guildenstern, who themselves were nothing more than pawns in the stratagems of Claudius, before killing Claudius in a very bloody fashion. Does this justify a noble death? You have to form your own conclusions on this.