I was a bit torn on this subject, but have now got my thinking straight.
Here's my train of thought for anyone who cares:
Everyone agrees (I imagine) that it would be wrong to punish a woman who had no idea they were pregnant when they did something foetus-damaging. Also it would be wrong to punish a women who did something that had a risk of harming the foetus, but for completely understandable reasons (eg they were on a very necessary medication, and the risk of affecting the foetus was small). Let's call these women categories 1 and 2.
At the other end of the scale we have women who know they are pregnant and genuinely don't give a shit what happens to the foetus. They take drugs, drink loads, smoke, etc. Let's call these women category 4.
Perhaps somewhere in the middle sits category 3 - women who are, for example, alcoholic, or addicted to drugs/cigarettes. They know they are pregnant but due to their addiction they drink/take drugs anyway.
You might think that category 4 women deserve different and harsher treatment, legally, from categories 1 and 2. But the thing is, there is no practical way to distinguish between these categories. You can't be sure which women knew they were pregnant, and which didn't. And you can't draw any sensible line between a risk which was "necessary" and one which wasn't. (For example, if a pregnant women takes a car journey and the foetus is hurt in an accident, was that journey "necessary"?)
So, any law you make which is aimed at category 4 must also work for categories 1 and 2.
And there you end up with the result that this is bonkers.