The purpose in the mad men dance is actually tightly related to one of the central themes of the play, which is that of deception. The mad men, we are told by Isabella in Act III scene 3, because of their madness, are incapable of deception, and in fact display every thought and emotion that comes into their minds, therefore rendering them "mad" in Elizabethan terms. Note how she describes them to Antonio when the mad men appear in this scene:
Yet are they but our schools of lunatics,
That act their fantasies in any shapes
Suiting their present thoughts; if sad, they cry;
If mirth be their conceit, they laugh again.
What makes the mad men so important is the way that they contrast so strongly to the central characters in this play, who all, in some way, pretend to be what they are not for their own purposes. The mad men therefore act as an implicit criticism on this duplicity, as they present complete honesty, being unable to indulge in subterfuge because of their "madness." The irony of the mad men is that in a play that is so much about lies and deception, the characters labelled "mad" are the most honest.