Looking at it properly, I agree that in principle the court should not be allowed to force a mother to attend hospital. In the UK, that couldn't happen unless the mother lacked mental capacity. That's because in the UK, as a PP has pointed out, the unborn child is not regarded as a separate person with rights, and the woman has the autonomy to do what she wants with her own body.
The reason the ECHR upheld this decision was made "on the basis that Spanish legal protection afforded to children extended to an unborn child." To my mind, this is all about the extent to which the ECHR should, or should not, be allowed to overrule national law. And even though I don't agree with the decision, I can see why they made it - I think there is an argument for saying that the ECHR shouldn't overreach its remit.