Answer:
To deceive Ophelia into thinking that he is no longer in love with him.
Explanation:
In Hamlet Act II, Scene 1, Ophelia describes Hamlet's appearance as disheveled and mad because that is what Hamlet intended to make Ophelia see of him. He wanted to deceive Ophelia into thinking that he is no longer in love with him.
Hamlet knew that Claudius and Polonius were watching and listening to thier conversation, so he purposefully deceived Ophelia by telling her that he never loved her to confuse Claudius and Polonius.