One of my friends is currently an elementary school teacher and is pregnant.
It got me wondering...I've been under the impression that primary education has been "women's work" since the 1800s. Even nowadays, the field is mostly filled with young women. But it was taboo to even say the word "pregnant" on TV even into the 1950s. Historically, were young women not allowed to teach while they were expecting? Were teachers in the past primarily older women past childbearing age? When did this shift happen?
Although I believe it is implied in the body of your question, just to be clear, you are principally interested in the 19th to early 20th centuries, and I presume most likely in America, at that?
I can't give you any sources for this (all I could find was something from the government of Iowa) but I believe teaching was mostly male before the American Civil War, and when teaching became mostly female afterwards teachers were expected not to be married. How that evolved to our present situation, I can't say.