Because it is a medical issue and medical practice is covered by laws.
The question of whether a woman should be allowed to have an abortion or not, except in an individual case, is not a medical issue, and it's not for medical reasons that people have this argument or create and/or change that particular law.