I completely agree with pohnpei's statement above. And it would be good to look at the "what a piece of work is a man" passage as but a continuation, in mood and intent, as the lines which precede it:
I have of late—but wherefore I know not—lost all my mirth, forgone all custom of exercises; and indeed, it goes so heavily with my disposition that this goodly frame, the earth, seems to me a sterile promontory; this most excellent canopy, the air, look you, this brave o'erhanging firmament, this majestical roof fretted with golden fire, why, it appears no other thing to me than a foul and pestilent congregation of vapours.
All things presently esteemed by the philosophy of the time, be it the earth and the sky above, or man himself, seem to Hamlet to be of little value and are now gross and vile by nature.
Does he really feel this way? Yes, probably. And moreover, he speaks these lines to old school friends of his, Rosencrantz and Guildernstern, whom he knows have been sent for, by his uncle, to spy on him. Nothing much delights Hamlet, and rightly so. This is no anti-Renaissance humanist speech; this is spoken from the heart to friends who have betrayed him.
He is not being fully honest, however, when he says, "I have of late—but wherefore I know not—lost all my mirth." On the contrary, he knows why only too well.
This famous speech is found in Act II, Scene 2 of Hamlet. It departs from what you call "typical Renaissance humanism" because it rejects just about everything that Renaissance humanism stood for (at least in terms of its attitudes about people).
Renaissance humanism argued for the value and importance of people. It believed that they had the ability to reason and think for themselves. But when you look at Hamlet's speech it seems he is making fun of such ideas.
He talks about people's ability to think -- their "reason" their "faculty" and their "apprehension" -- and equates them with gods. This would be more or less what humanists would have said. But Hamlet is saying it sarcastically and thereby denying everything the Renaissance humanists would have said.