"Frailty, thy name is woman" (1.2.6)—but Hamlet's men are pillars of stability and constancy, right? Right?? Well, maybe not. But Hamlet's attitude toward women is definitely sexist, and it stems from his disgust at his mother's sexuality and seeming unfaithfulness to his dead father. But the play doesn't seem to agree. Hamlet's mother's final guilt is left ambiguous, and we just end up feeling really bad about Ophelia. Hamlet's attitude toward women reveals more about him (and maybe men in general) than it does about women's true nature.
Hamlet is critical of women because he believes that their sexual "appetites" constantly lead them to betray men.
The play doesn't share Hamlet's sexist attitude. In fact, it paints a sympathetic picture of Ophelia and seems to blame the men for her tragic death.