Because depending on your viewpoint there’s multiple persons rights at play. The woman, the man, the “child”. They need to be balanced some way.
If you think the fetus is a person, then don't get an abortion. It's super easy. And if your fetus is killing you, then feel free to die for your beliefs.