I agree, on that count. By telling the other parents and teachers, the school probably violated the law concerning privacy. They did nothing wrong, however, in firing her for the infraction itself.
You don’t find asking a married, pregnant woman when she conceived to be morally repugnant and criminally invasive? I sure as hell do.