Polonius attributes Hamlet's erratic behavior to Hamlet's love for Ophelia, Polonius's daughter. Polonius says Ophelia has confided in him that Hamlet is in love with her. Because Claudius murdered Hamlet's father, he worries that Hamlet's strange behavior means Hamlet has heard a rumor that his father died an unnatural death. Claudius knows that if Hamlet discovers the murder, he will be honor-bound to avenge his father's death by killing Claudius.
Claudius, naturally, would be greatly relieved if Hamlet's stange behavior could be traced to being in love. He could then rest easy, knowing that Hamlet's bizarre actions had nothing to do with his father's murder but rather were the course of normal lovesickness. This is not the case, but Polonius is doing his best to try to find the reason for Hamlet's "madness," and Claudius would be happy for his solution to be true.