Because a fetus isn’t a person. Until birth it is considered a part of the mother, specifically to prevent stupid and unsustainable rulings like this one. If your mother was killed by cancer, are you going to take her tumor to court and put it in prison? No, you wouldn’t, that would be ridiculous. Because a tumor can’t choose its actions. Neither can a fetus.
After development and birth, when the child can think and act for itself, sure it’s a person. Inside the womb? It is an organ, it acts and thinks like an organ (by which I mean, it doesn’t) and can hold no legal responsibility for anything because it is not a thinking being.
Do I find this to be sad? Sure, absolutely. I’d prefer every fetus in the world to be loved and wanted and born without complication into a life of ease. But you and I both know very well that that is not the reality of the world.