This is a thing that villains do in the plays all the time. Richard the Third puts on a show of piety. Iago pretends concern and care. Angelo puts on a face of purity. Hamlet, in talking like this to his mother, is sounding a wee bit villainous. He’s not at his best in this scene is Hamlet. At least for a modern reader, watcher, engager.
But he does say Assume a virtue… which any note will tell you means Pretend, Fake – but with a modern reading, it could be a little less villainous sounding – a kind of assumed virtue, presumed virtuous until proven otherwise. Or putting on virtue, like a coat, like another identity. Like a uniform. Like – put on the nun’s habit even if you don’t feel like a nun.
Still though…villain talk.