And while you might see pregnancy as equivalent to having a medical condition there are actually a number of fairly important differences. For example, in the modern era, pregnancy is more controllable than illness. Quite a number of people enthusiastically plan on it. Those aspects, intent and control, are important for determining who should bear the cost. The cost should not settle on an unwitting employer looking for a new hire.
Fortunately this is exactly how it's implemented in most European countries: if the employee is not working the employer doesn't pay. The (usually state run) insurer does.
Requiring businesses to pay for someone taking time to care of their children is patently stupid and unjust and there is fully justified pushback against such laws.
But they are - that's the law. The same legal system that allows the corporation to exist at all and earn money in this environment requires them to ignore the fact that someone may be going on maternal leave and not discriminate based on it.
We the voters have decided that this is more important than the profits of any company, and in the end the voters (i.e. mostly employees) get to decide the rules of society, not the companies.
An employee expecting, or indeed planning, to take a X months leave Y months after joining, with X > Y, isn't an irrelevant dimension. Especially if parental leave is paid, but I don't know if that is how the US handles leave.
An employee literally cannot be a high quality, productive worker if they are not working. Employers should not be forced to ignore relevant factors when hiring. That isn't fair on them.