The reason that Viola hides herself (by wearing men's clothing and pretending to be Cesario) is that she wants to find her brother, Sebastian. Sebastian has been shipwrecked but Viola has reason to believe he's still alive.
Her decision to disguise herself definitely makes sense. In the days when Shakespeare wrote the play, a young woman could certainly not go around on her own. She would have been expected to act in "womanly" ways that would not have allowed her to seek Sebastian.
Her disguise is not enough to hide her character. She remains the strongest character in the play.