Answer: Hamlet is projecting his anger at his mother onto Ophelia.
Step-by-step explanation:
By the time Hamlet meets Ophelia in Act 3, Scene 1, he is already both irritated and sad. He has suffered a lot - his father has been murdered (by his uncle, as it turns out), and his mother also married his uncle shortly after his father's death. Hamlet is angry not only at his mother for this betrayal, but at the whole female gender. Women are, according to him, too naive (look at his speech in Act 1, Scene 2 in which he says "Frailty, thy name is woman!"). Ophelia is, therefore, just a victim that Hamlet directs his anger at.