Originally, classical drama was performed at religious festivals, and the purpose involved honouring the gods. Comedy, especially, developed early into a genre devoted to entertainment, but nonetheless, even Aristophanic comedy, despite its earthy humour, contains serious political and moral criticism. Roman comedy, and especially mime was primarily intended as entertainment, but still inculcated civic norms. The medieval morality plays were intended to teach, but to do so in a pleasant form. As one moves into modern drama, the purpose may be primarily entertainment, but many plays have serious political or moral aims, and audiences may learn about anything from appropriate conduct in their own society to how other cultures or periods have functioned by watching plays. Thus overall, it’s not really so much either educate OR entertain but both educate and entertain (dulce et utile).