Hamlet has been very disturbed by his meeting with the ghost. He is unsure what to do and (possibly quite rightly) mistrusts the ghost who he feels may be a 'goblin damned' or something sent in a familiar guise to trap him and feed him false information. He certainly is upset by his mothers marriage and has an increased reason to hate Claudius. Thes factors have led to him mistrusting women and when Ophelia returns his love letters on the instruction of her father he probably feels betrayed by her too. Don't forget he has told Horatio he will put on an 'antic disposition' to hide behind a 'madness' whilst he works out what to do. This is behind his meeting with Ophelia when she complains of him coming to her as she sewed and:
Lord Hamlet, with his doublet all unbraced;
No hat upon his head; his stockings foul'd,
Ungarter'd, and down-gyved to his ancle;
Pale as his shirt; his knees knocking each other;
And with a look so piteous in purport
As if he had been loosed out of hell
To speak of horrors,--he comes before me'
To Polonius this is evidence of Hamlet being mad with love, but the evidence points more to his desperate unhappiness and general desire to work out who his real friends were, beyond the trusted Horatio.