Principal Margaret was a robot created by Madam Margaret to help her past self Margie to look like the director of St. Rita's Preparatory School. Margie controled the robot from below using its robotic legs as a walker while the top was apparently manhandled artificially, although it only spoke when Margie did.
After the bus drivers from St. Rita's Preparatory School took Numbuh 4 to her, Principal Margaret welcomed him to school and took him to her class, where she tried to use a Girlifying Rifle to make him a girl. Nevertheless, Numbuh 4 used speckles to make dust and escaped from Principal Margaret, who made a tantrum before going to her office and talking to Madam Margaret, Margie's future being.
Once in the office, as Madam Margaret was busy with a major issue of her dystopic future, Principal Margaret recorded the message she needed to tell her. However, Numbuh 4 appeared in the window, and swayed with the lamplight to land on Principal Margaret's face. Big was his surprise to realize that he had split the robot in half, revealing Margie from the dress, with which he began to argue while she was using Principal Margaret's robotic legs to walk. However, during all this time Principal Margie's torso had regained consciousness and was willing to help her creator, it got the Girlifying Rifle and used it to try to girlifyer Numbuh 4, but this managed to shut down once and for all Principal Margaret and destroyed the rifle.
It's completely unknown how Margie's defeat in the present affected its existence (considering the fact that she was supposedly created by Madam Margaret). If the first was the case, it was likely erased from existence but if Margie created it at the present, is likely that its body out of service remained in the tower until the school was destroyed, presumably dragging its remains.