Can my Employer Fire me Because I Had a Child out of Wedlock?

I am not married. I decided to have a child because if I waited to find the right man to have one with, I would not be able to have a child. My employer has fired me because I had a child out of wedlock. Is that legal?

By Deskin Law Firm