In act three, scene one, Ophelia interrupts Hamlet's moving soliloquy and follows her father's orders by returning his romantic gifts while Claudius and Polonius spy on them. Hamlet initially denies ever giving Ophelia any of the presents and admits that he does not have romantic feelings for her. After Hamlet tells Ophelia that he never loved her, he tells Ophelia,
"Get thee to a nunnery" (Shakespeare, 3.1.131).
He then proceeds to ask her why she would ever want to give birth to more sinners like himself, who are capable of committing horrific deeds. Hamlet then criticizes himself by listing his numerous vices and pronouncing that every person is an "arrant knave" before encouraging Ophelia to once again hurry to a nunnery.
One could argue that Hamlet's negative feelings towards his mother, Gertrude, have led him to the conclusion that the best place for a woman to be is in a nunnery, where she is forbidden from having sex and free from influential, sinful men like Claudius. Despite his love for Ophelia, Hamlet is completely jaded in regards to women and does not have a positive view of himself. Hamlet then proceeds to criticize marriage and his apparent frustration with women in general sets the stage for the impending confrontation with his mother.