Literary critics have pointed out that Shakespeare wrote during a time of important sociopolitical changes considering that there was a switch from a patriarchal monarchy to a matriarchal monarchy. Shakespeare wrote for Queen Elizabeth's court and a significant social concern of the time was whether or not a woman was capable of handling the throne. Literary critic Jane Dall points out that many of Shakespeare's plays and themes "reflect political gender anxieties" ("The Stage and the State"). In particular, Dall asserts that both Hamlet and Macbeth have women in power taking a significant fall while men in the plays regain power, showing that Shakespeare questioned a woman's ability to be in power and intimating his hope for a "return of state stability" through the reestablishment of a patriarchal monarchy ("The Stage"). Hence, we can claim that one reason why Shakespeare appears to criticize authority figures in his plays is because he is questioning the strength of his own monarchical government, wishing instead to return to a patriarchal monarchy.
We can see Shakespeare questioning women's ability to maintain power in Twelfth Night when he has Olivia marry by the end of the play. When we first meet Olivia, she has recently lost both her father and brother, leaving her to manage her family's estate all on her own. It can be said that one reason why she has rejected Duke Orsino's proposal is because she wants to maintain total control of her estate, thereby ensuring that the estate is not compromised. However, she is unable to keep maintaining control as she soon finds herself falling in love with one who is actually a perfect reflection of herself--a woman alone with an estate she needs to protect who also feels the need for disguise. Regardless, Shakespeare has nature correct this course by having Olivia mistake Sebastian for Cesario and marry Sebastian instead. Sebastian comments on the fact that nature led Olivia to a union with Sebastian, rather than Viola pretending to be Cesario, in his lines:
So comes it, lady, you have been mistook:
But nature to her bias drew in that.
You would have been contracted to a maid. (V.i.268-71)
But now that she is married to Sebastian, she is no longer in control of her own estate, which also reestablishes the patriarchal control within her household and seems to be what Shakespeare wants for his own government.
What's also interesting to note is that Duke Orsino, Illyria's true ruler, while portrayed as a noble leader, is also characterized as a bit fanciful and foolish, which can be interpreted as Shakespeare's means of criticizing Orsino. But, Shakespeare also creates balance by uniting him with the wiser Viola. Perhaps portraying Duke Orsino as fanciful and foolish is Shakespeare's way of showing that even a patriarchal government can be insufficient and any form of government must be balanced to create a balanced society. Having both masculine and feminine counterparts in a leadership union would create that balance.