Hamlet is a noble character who flirts with insanity and has some less than stellar characteristics which make him unlikable at times. He does indeed act like "a devil" to his loved ones, since he believes everyone has betrayed him. He torments Gertrude and Ophelia. He impulsively murders Polonius. He has Rosencrantz and Guildenstern executed in his place in England. Trying to avenge his father certainly does not bring out the best in Hamlet.
And yet, Hamlet is capable of great compassion. When he stalks off to his mother's chamber to tell her what he thinks of her marrying her brother-in-law, he does say he does not wish to be too unkind toward her. We learn he was once a tender lover to Ophelia and a good friend to Rosencrantz and Guildenstern. His intelligence, thoughtfulness, and lack of lust for power all imply he would have made a great king had circumstances been more favorable. One of the most tragic things about the play is that Hamlet's potential for greatness is cut off by his death. In the end, Denmark was cheated of a good ruler.