It's a mix of practicality and aesthetic. Today, in our maskless theatre society, a lot of the acting comes come from facial expressions and other forms of physicality (i.e., it's more than just delivering the lines), and you're at an advantage as an audience member if you are sitting close to the stage, because you can see the minutiae of this physical acting and appreciate it more. Ancient Greek actors had to perform for over 10,000 people, and if you're sitting in the way way back, you're going to have immense difficulty seeing or hearing what an actor is saying if they don't have any sort of enhancement (like a microphone, which supposedly didn't exist 3000 years ago). Masks were designed to give Greek performers a way to amplify their voices to be heard by everyone, as well a showcase something resembling a facial expression that can be again be seen by everyone. Up close, you might be able to see an actor frowning and being upset, but from far away, this will make it very easy to figure out what their character is feeling.
On top of that, Greek plays included a decent number of characters, but there were typically only three actors. Greek theatre featured a ensemble of about 15 people, most of whom made up the chorus, who sang/spoke together as a singular unit to help progress the narrative. Only two or three actors actually played real characters, which meant actors were playing multiple people. Masks gave a way to indicate which character was on stage and which wasn't.
Further Reading
Dearden, Chris. The Stage of Aristophanes. London: University of London, Athlone Press, 1976. Pages 86-88, 122-126.
Sewell, Richard C. In the Theatre of Dionysos: Democracy and Tragedy in Ancient Athens. McFarland, 2007. Pages 25-26.
“The Greek Mask.” Joukowsky Institute for Archaeology. Brown University, n.d. https://www.brown.edu/Departments/Joukowsky_Institute/courses/13things/7420.html.