I think often we can forget the state that Viola finds herself in at the start of the play as we move on to the comedy of Illyria and the love sick nature of so many characters. However, many critics argue that successful comedies can often be separated only by the finest of lines from being a tragedy, and Viola in Act I scene 2 finds herself in a desperate situation, swept up on a foreign shore where she is friendless, unknown and may have potentially lost her brother in the shipwreck that exiled her to these shores. It is always dangerous for a woman to be by herself and without connections, so it is probably a very shrewd move on her part to disguise herself as a man. Note Viola's own words:
...And might not be delivered to the world
Till I had made mine own occasion mellow,
What my estate is!
In this speech, Viola expresses her desire to not be revealed to the world until it is convenient for her to reveal her position into society until she knows what that position is. Given the uncertainty of her position, this is a definite advantage. However, as we find out, living as a man in man's company brings its distinct disadvantages, especially when women fall in love with you and you are unable to express the love you have for your Lord because of your supposed gender.