I have to agree with everyone else on the probationary period thing. During that period, they can technically fire you for anything.
I do , however think that firing a pregnant woman just because she's pregnant (and no other reasons) is considered discrimination. There are a lot of laws about that, and some specifically concerning pregnancy. I was having issues with my job wanting me to lift heavy things (people!) when I was pregnant, so I looked into all the laws and such. I know it varies from state to state though.
As far as them thinking you withheld information from them. Just tell them you didn't know you were pregnant when they hired you. Plenty of women don't know very early on.