I imagine that out of every 200 teachers in a school, at least one takes three weeks off due to some reason, such as being ill, giving birth, having an operation, a result of an accident or something like that. It seems to me that the school should have a substitute that could follow this teacher's lesson plans and not really impact the education of her students.
The Hadjj in Islam is decreed to be required only once in a lifetime. I can see where the school could be justified in giving her a leave without pay, but firing an otherwise good teacher for one trip to Mecca in a lifetime seems excessive to me. It is not like she is asking for a paid leave to go to Yemen and build suicide vests. Muslims do not ever, in my experience, seem to be judgmental about non-Muslims eating ham, or the lack of Muslim beliefs among others.
The Muslim calendar has only 354 to 355 days, so the month for the hadjj cycles through the seasons. as the solar calendar has 365.25 days. At some point, the proper month for the hadjj will fall during her summer vacation or perhaps the Christmas holidays.