Claudius is an inherently devious and manipulative character. Having carefully plotted and schemed his way to the top, he is suddenly confronted by an unexpected problem: Hamlet's desire for revenge, spurred on by the ghost of his murdered father. Claudius needs to use every ounce of his manipulative powers to stop Hamlet from getting any ideas in the direction of acting on his desire. At the very least, he needs to encourage his crestfallen nephew to move on and cease his endless moping around, his "unmanly grief":
'Tis sweet and commendable in your nature, Hamlet,
To give these mourning duties to your father:
But, you must know, your father lost a father;
That father lost, lost his, and the survivor bound
In filial obligation for some term
To do obsequious sorrow: but to persever
In obstinate condolement is a course
Of impious stubbornness (Act I Scene II).
Claudius's whole marriage to Gertrude stands as a testimony to his guile and manipulation. And this little speech, though ostensibly addressed to Hamlet is really for Gertrude's benefit. Claudius wants to get Gertrude to persuade Hamlet not to go to university in Wittenberg; in doing so, he is playing on her motherly affections. Claudius wants Hamlet where he can see him, the better to be manipulated and controlled.
Or rather Claudius wants someone else to keep an eye on Hamlet, namely Rosencrantz and Guildenstern. Claudius would have them (and us) believe that he is merely looking out for the boy, worried by his growing gloom and melancholy. In fact he is actually trying to feel Hamlet out to gain a sense of his ambition in relation to the throne. It is noticeable just how often Rosencrantz and Guildenstern use the word "ambition" when they talk to Hamlet.
Later on, Claudius manipulates Hamlet's school friends further when he sends them on a mission to accompany Hamlet to England. Hamlet is considered mad and must leave Denmark on the grounds of public safety. But in truth Claudius has other ideas. Rosencratz and Guildenstern have been duped into participating in a wicked assassination plot.
Contrast Claudius's approach to Hamlet with how he later on deals with Laertes. He is every bit as manipulative but this time for a wholly different, and more deadly purpose:
Not that I think you did not love your father;
But that I know love is begun by time;
And that I see, in passages of proof,
Time qualifies the spark and fire of it.
There lives within the very flame of love
A kind of wick or snuff that will abate it;
And nothing is at a like goodness still;
For goodness, growing to a plurisy,
Dies in his own too much: that we would do
We should do when we would; for this 'would' changes
And hath abatements and delays as many
As there are tongues, are hands, are accidents;
And then this 'should' is like a spendthrift sigh,
That hurts by easing. But, to the quick o' the ulcer:—
Hamlet comes back: what would you undertake,
To show yourself your father's son in deed
More than in words? (Act IV Scene VII).
Claudius wants Hamlet to stop brooding on the death of his father and move on. With Laertes it is the exact opposite: Laertes must never forget Polonius and should avenge his death as soon as possible. In both cases, Claudius is thinking, as always, of his own motives.