"A man may smile, and smile, and be a villain"
This sentence is a warning to Polonius that Claudius may not be as trustworthy as he seems. Hamlet says this line after Claudius has just been acting friendly towards him, but Hamlet knows that Claudius is actually responsible for his father's death. Hamlet wants Polonius to be aware that Claudius is not to be trusted, and he hopes that Polonius will pass on this warning to the king.