Let me clarify Mary was unmarried at the time her pregnancy was revealed ( to Joseph) He considered ending his engagement to her which would have resulted in her being stoned to death as her pregnancy became obvious.
The reason I brought this up was to demonstrate that the Catholic Church does not condemn pregnant women as a condition of their pregnancy but out of a stubborn refusal on the part of the pregnant woman ( teacher in this case) to provide a home that includes two married parents.
Luke 1:35
“The angel answered, “The Holy Spirit will come on you, and the power of the Most High will overshadow you. So the holy one to be born will be called the Son of God.”
- NIV in this case or use whatever translation one sees fit.
Her case though is unique, of course, she is sometimes even called “Spouse of the Holy Spirit”.