First-time readers of Shakespeare's Twelfth Night might wonder why Shakespeare devotes so much stage time to the goofballs Sir Toby and Sir Andrew. They are silly and obnoxious, and they don't always seem to contribute much to the play's plot. Yet Shakespeare has good reasons for writing them in, and we would miss some very important things if they were cut.
First, the play would lose much of its humor. For all their foolishness, perhaps in all their foolishness, Sir Toby and Sir Andrew are hilarious. They continually play with words, making puns and jokes through multiple meanings and “misunderstandings,” allowing Shakespeare to show off his mastery of words. And of course, the two men throw in plenty of bawdy talk as well, some of it subtle, some of it not so much. They are Shakespeare's outlet for such audience-appealing lines in this play.
Further, Sir Toby and Sir Andrew stand at the center of Twelfth Night's most outrageous prank. Along with Maria, they trick Malvolio into thinking that Olivia is in love with him, and they get him to act in the most outrageous and humorous ways. He even wears yellow stockings and crossed garters and runs around talking of politics, thinking that Olivia will be pleased. She simply thinks he is crazy. The conspirators run with the “crazy” idea. They lock Malvolio up and even get Feste to pretend to be a priest and examine him. Of course, their prank does drift into the realm of cruelty, and the audience is left to think about how far a joke can go before it turns mean. This, too, is a function of Sir Toby and Sir Andrew.
Finally, these two men provide an important point of conflict for Viola/Cesario. Sir Andrew challenges her to a duel, not realizing that she is not a young man. Sir Toby and Sir Andrew then mistake Sebastian for his disguised sister and end up taking quite a beating. They thereby contribute to the resolution of the plot as Viola and Sebastian end up side by side and their true identities are revealed.