There were many allusions to Greek mythology in the story. For example, Grover Underwood, the Satry, is a species from Greek mythology. However in the story he wears clothes so he can attempt to look like a regular kid.
Twain uses irony and sarcasm to characterize the king and duke in such a way that communicates his belief that pretending to be something you are not (for the sake of appearances) is both ridiculous and embarrassing.