They do have the same reason for spying on Hamlet and Ophelia and discovering the reason for his madness. However, while Polonius wants to find out whether he is right about Hamlet being lovesick, Claudius wants to determine how Hamlet's madness will affect his kingship.