At this point in the play Hamlet has hidden Polonius' body and Rosencrantz (and Guildenstern and others) wants to know where it is so he can give him a proper burial. Hamlet is no fool and refuses to tell him where the body is. He proceeds to tell Rosencrantz (and Guildenstern and others) that he is a "sponge" to the king, he is basically saying that the king is using Rosencrantz and when his purpose has been served he will no longer find favor there. When he says this line "a knavish speech sleeps in a foolish ear" he is telling Rosencrantz that his good advice has been lost on his "friend's" stupidity and desire to be in the good graces of the king. The "knavish speech" speaks to is Hamlet's own insight to see the king for what he really is, decpetive and the "foolish ear" is speaking to Rosencrantz foolishness in trusting the king so blindly.