This is an excellent question. Please note that my response is my opinion and not some fact I've found through research. First off, if purgatory exists, not all souls stuck in purgatory are going to be purified. Some might stay stuck. Some might descend into the hell realms after a second judgment. Second, Hamlet IS confused by his father asking him to kill his uncle. Hamlet wonders if his father is real or if Hamlet, himself is hallucinating. He wonders if this spirit is benevolent or if he is a demon trying to trick him into committing a mortal sin. Beyond that, I think Hamlet's "To be or not to be" soliloquy speaks to his troubled mind and soul when determining whether or not he should follow the will of his father's spirit.