There are two female characters in 'Hamlet': Gertrude, Hamlet's mother and Queen of Denmark, and Ophelia, Hamlet's would-be lover. The women themselves have relatively little stage-time, so they are mostly presented through Hamlet's voice, and become focal points for his fears and desires. He creates a Madonna/whore distinction, where Gertrude is lustful and 'pernicious' and Ophelia pure and innocent. This distinction is then troubled in his 'Get thee to a nunnery' tirade, where he both rails at Ophelia for her impurity and tasks her with preserving her purity.
In a sense then the misogynistic presentation of women serves to convey Hamlet's fracturing sanity, but it also channels the way women were presented to the world at the time, both in the theatre and daily life. Hamlet relays some staple misogynistic tropes from the period, calling Ophelia dishonest because she wears make-up, and telling her not to have children (we might think of King Lear's "Into her womb convey sterility..."). Other points to think about include Ophelia's mad song and suicide - is she as innocent as Hamlet thinks? - and Ernest Jones' Freudian interpretation of the play, which attempts to explain Hamlet's obsession with his mother's sex life.