Hamlet is a good person, but he would not necessarily have been a good king. He is a thinker, not a ruler. He spends too much time considering questions of morality, and not enough time acting.
This would make him the type of person I wish would rule, but, also (unfortunately) not the type of person destined to hold power. The qualities that Hamlet does possess that would have made him a good king: loyalty (he is both fiercely loyal to his father and actively angry at what he sees as his mother's disloyalty); morality (he has a clear sense of right and wrong); wit (although some might argue that intelligence is not necessarily a quality essential in a ruler...); sufficient powers of observation to know where his friends are and are not (Rosencrantz and Guildenstern, for example); the ability not to act impulsively but to plan revenge carefully (the play); and, in an Elizabethan world, moral superiority... quite simply he is the person in the play closest to God, the one who is most likely to have had the divine decree to rule, for he is just and wise. I would also argue that his apparent failure to act decisively might also be a point in his favour, for his actions are not rash, but are delivered after much deliberation and after sufficient planning as to appear justified.