There are a couple of reasons Shakespeare has Viola dress as a page, one is practical and the other plot driven.
Since the parts of young females were played by young boys, it was more comfortable for them to dress and act like young men. This, of course is the practical reason.
For several of his comedies, Shakespeare used twins. In this case, it was better to be identical male and female twins. (Genetically not possible but this is a play.)
Her reason for dressing as a male is a little weak but it works to get her in Orsino's court where she can fall in love with him and where she can be sent to Olivia's where she falls in love with the disguised Viola.
Mistaken identity and misunderstanding are the keys to "new" comedy. Shakepeare understood this and used these elements masterfully.