Macbeth is certainly more evil than Hamlet. Macbeth, at least in some points in the play, acts out of ambition and a desire for power. While he is influenced by the Weird Sisters and Lady Macbeth, and seems to repent to some measure by the end of the play, he nevertheless commits murder due to his ambition to become king. While Hamlet's actions are not always "good," he acts not out of greed or a desire to cause harm to anyone aside from Claudius. While his actions might result in others being hurt, he acts nonetheless from the pure intention of avenging the murder of his father. Macbeth's motivations are not nearly as righteous as Hamlet's are.
Macbeth's actions are based in ambition and desire for self-advancement. He commits murder in order to achieve his goals. This is the essence of evil behavior; the only thing more evil would be killing for the pure pleasure of taking a life. Although Macbeth does feel remorse after murdering the king, he is nonetheless willing to continue committing criminal acts in order to preserve his position.
Hamlet, on the other hand, is caught between his desire to avenge his father's murder and his inability to determine beyond doubt the guilt of his uncle. When Hamlet kills, it is based in the notion of revenge and family honor. This is not a purely evil motivation for taking a life; nonetheless, it is significant enough to cause Hamlet to agonize over the decision.
Without question, Macbeth is more evil, for his thoughts of murder center around his cupidity; his motives are purely selfish. Hamlet, on the other hand, does not entertain the idea of regicide until the ghost of his father appears, requesting that his murder be avenged. Even then, Hamlet, in tortuous soliloquies, debates the idea of killing Claudius and is reluctant to act. For instance, in his famous "to be or not to be," in Act III Hamlet reflects upon his inaction:
No traveller returns, puzzles the will,/And makes us rather bear those ill we have/Than fly to others that we know not of?/Thus conscience does make coward of us all,/And thus the native hue of resolution/Is siclied o'er with the pale cast of thought,/And enterprises of great pitch and moment/With this regard their currents turn awry/And lose the name of action. (III,i, 80-87).
In the following act, Hamlet yet engages in self-debate. He reflects,
Witness this army of such mass and charge,/Led by a delicate and tender prince,/Shose spirit,/With divine ambition puffed/Makes mouths at the invisible event,/Exposing what is mortal and unsure/To all that fortune, death, and danger dare,/Even for an eggshell..../How stand I then,/That have a father killed, a mother stained,/Excitements of my reason and my blood,/And let all sleep, while to my shame I see/The imminent death of twenty thousand men/That for a fantasy and trick of fame/Go to their graves like beds....(IV,iv,47-62)
Over and over, Hamlet hesitates to kill Claudius when he would be avenged and made king himself. On the other hand, Macbeth rushes to kill Duncan in the first act, and when he is worried that Banquo and his sons may reign in his stead, he does not hesitate to have them murdered in Act III:
To be thus [king] is nothing, but to be safely thus--/Our fears in Banquo stick deep...(III,i,48-49) (He then tells two men to murder Banquo and his son.)
Hamlet spends much of his time reflecting upon what is "rotten in Denmark" while Macbeth, in his fear that someone else may become king or take his reign from him, rushes to slay men and their families as well. As reluctant as Hamlet is to follow the supernatural advice, Macbeth is eager to accept the prophecies of the witches and accelerate their fulfillment.