Under Title IX, if your school gets government money (including private schools that accept government grants – basically if you’ve ever had to fill out a FAFSA), your school CANNOT discriminate against you for being pregnant.
They also have to allow you more accommodations, such as extra absences and the ability to make up extra credit work if you miss class due to your pregnancy. Even if your professor has an absence policy, your Title IX rights trump that.
Read about your rights here:
http://www2.ed.gov/about/offices/list/ocr/docs/dcl-know-rights-201306-title-ix.html