Allow me to clarify:
Assuming that your employer is subject to the Pregnancy Discrimination Act (15 employees) and/or the Family Medical Leave Act (50) employees, you cannot be laid off BECAUSE you were on medical/maternity leave.
However, taking neither maternity or medical leave protects you, under any law at all, from a layoff that would have taken place regardless. If you would have been laid off had you not taken maternity leave, you can be laid off now. Pregnancy/maternity/medical illness grants no special rights or protections for layoffs done for business reasons.