"She likes the teacher."
Translation:Magister ei placet.
magister (or magistra) ei placet is quite literally 'the teacher is pleasing to him/her/it'. The teacher is the one doing the 'pleasing' so it has to be in the nominative.
The given translation by Duo is just a more natural way to say it in English.
See DavidPNash's comment to EthanCordr (below at the time of writing) for another explanation.
'She' is represented in the sentence by ei (which could also mean he or it).
The sentence Magister (or magistra) ei placet is more literally 'The teacher is pleasing to her (or him or it)'. They probably just use the sentence 'She likes the teacher' so the English is a little more idiomatic.
The teacher is the subject (nominative) and is doing the action of pleasing. Adding illa with magistra would make the sentence more like 'She likes that teacher' or 'That teacher is pleasing to her'. It wouldn't work with magister.