At the start of the opera The Magic Flute, Sarastro is in a somewhat controversial position. He has inherited the position of the head of the Temple from Pamina's father, much to the displeasure of the Queen of the Night (Pamina's mother) who had hoped she would inherit it. He has added to the Queen's displeasure by removing Pamina from her care because of the influences being placed upon the girl by her mother. It's interesting to think how improbable this situation actually is in today's outlook - nowadays it simply would not happen in Western countries that a man not related to the family would be able to remove a child or young person from their parents! However the Flute is a total fantasy and must be taken on its own terms and the fact that it was written in part celebrating Mozart's and Schikaneder's initiation into Freemasonry should also be taken into account.
Within the opera Sarastro is seen throughout as being on the side of the light and therefore good, though as mentioned above he is more than something of a tyrant - Monostatos is handed a thorough beating after Pamina tries to escape from him and tells Sarastro that Monostatos had refused to leave her alone. In that scene in Act 1 where Sarastro first appears Pamina is also refused permission to return to her mother despite pleading with Sarastro to do so. And Sarastro is also responsible for the eventual decision that Tamino and Papageno will undergo the trials to see whether they are suited to the final ordeal.
However, in Act 2 of the opera Sarastro overhears the conversation between Pamina and the Queen of the Night who disowns Pamina because her daughter refuses to kill Sarastro. He comes in at a particularly juicy moment when Monostatos is trying to blackmail Pamina (which is the last straw - Monostatos is dismissed at this point and joins the Queen's household). Sarastro is throughout the opera seen as a protector rather than a tyrant and after the Act 1 chorus and Pamina's return this does become clearer and clearer.
Just as Sarastro is in personal terms the opposite of the Queen of the Night (being the head of the temple and on the side of the light, whereas she is seen as being on the side of darkness and evil), his music is also the opposite of the Queen's. Where hers is full of rage and high coloratura, his music is calm and, as Sarastro is sung by a bass, goes to the opposite extreme in terms of pitch.
He is a most important character to understand in the opera, being the main cause of much of the Queen of the Night's angst and the main reason that Tamino and Papageno are sent on their first quest (which is to find Pamina and rescue her from Sarastro). It is interesting that although at the beginning of the opera he is seen as evil for having stolen away Pamina, at the point where Tamino meets the Speaker the whole opera swings round and Sarastro is seen in a completely different light - as is the Queen of the Night. It isn't just Monostatos who changes sides!