Do Claudius & Polonius have the same reasons for spying on Hamlet & Ophelia? How are their goals similar in Hamlet? How are they different?
In Shakespeare's Hamlet, Claudius and Polonius, on the surface, have the same reasons for spying on Hamlet and Ophelia, but only on the surface.
Both Claudius and Polonius are trying to figure out why Hamlet is "mad," or acting insanely. Polonius believes that Hamlet's behavior is due to his love for Ophelia being rejected by Ophelia (which he put her up to in the first place). He is trying to prove his theory to Claudius.
Claudius wants to know if this is the reason for Hamlet's insanity, too. In this respect, Claudius and Polonius are similar. But Claudius has a further motive, as well. He is trying to keep an eye on Hamlet and figure out Hamlet's behavior, so he can judge whether or not he is in danger from Hamlet.
Claudius, of course, has recently kept Hamlet from inheriting the thrown by marrying Gertrude, and has also "replaced" King Hamlet as Hamlet's father, at least technically. Neither of these make Hamlet happy. Claudius wants to know if Hamlet is so upset due to Ophelia's rejection, or due to the other recent events. Claudius is hoping that Ophelia's rejection is the cause of Hamlet's mad behavior. If that is the case, then Hamlet is no threat to him.
Of course, according to Hamlet himself, his behavior is all an act, a smoke screen, if you will. Hamlet says that he is only pretending to be mad, in order to, we assume, keep Claudius busy worrying about his madness, rather than about Hamlet's plans for revenge. Hamlet's madness is a diversion.
No, is the answer to the first question. Claudius spies on Hamlet because as he says, "Madness in great ones must not unwatched go." He is worried that Hamlet knows more than he is letting on. When Polonius thinks he has discovered the secret to Hamlet's melancholy and madness, Claudius is still skeptical that there must be causes other than a broken heart. "How may we try it further?" he asks Polonius. In other words, he wants to spy to determine whether or not Polonius' theory is correct, and the fact that he is skeptical shows that he is suspicious that there might be other causes: Hamlet knowing that Claudius is his father's murderer, specifically.
Polonius spies to curry favor with the king. Polonius is a "knee-crooking knave" and will do almost anything to gain Claudius' confidence, even if he must confiscate his daughter's love letters or use his daughter to trap Hamlet. Polonius sincerely believes that Hamlet suffers from a broken heart, from Ophelia's rejection of him, which Polonius ordered. He spies with Claudius in Act 3, scene 1, to prove to Claudius that he is right.
Their goals are similar in that each spies in order to maintain or advance his position--Polonius as the king's advisor; Claudius as the king. Neither wants to give up the gains he has made in his career. Spying on Hamlet helps Polonius with the king and helps Claudius keep an eye on a potential threat.