In addition to what the other commenter said, this case took place in California where abortion is fully legal and constitutionally protected. Not to minimize what’s going on in other states of course, but you’re comparing apples to oranges with that statement.
The penalty is for all revenue made, not all profit made. So they still lost money on this product with R&D, production, etc. expenses.