It is a good question.
From https://cks.nice.org.uk/topics/abortion/background-information/uk-abortion-laws/ (bolding mine):
A pregnancy can be lawfully terminated by a registered medical practitioner in an NHS hospital or premises approved for this purpose if two medical practitioners are of the opinion, formed in good faith, that either:
- The pregnancy has not exceeded its 24th week and the continuance of the pregnancy would involve risk, greater than if the pregnancy were terminated, of injury to the physical or mental health of the pregnant person or any existing children of their family.
- The termination is necessary to prevent grave permanent injury to the physical or mental health of the pregnant person.
- Continuing the pregnancy would involve risk to the life of the pregnant person, greater than if the pregnancy were terminated.
- There is a substantial risk that if the child were born, it would suffer from such physical or mental abnormalities as to be seriously handicapped.
So abortion is justified under as the lesser evil - a necessary healthcare intervention to avoid mental or physical harm. Obviously not all doctors are convinced of this thinking and are therefore permitted to conscientiously object.
NB 'pregnant person' noted - thanks NICE 🙄