So the benchmark here is the extent to which it harms people, the gravity of the harm.
Killing people is worse than torturing them. Therefore abortion is graver than child pornography. So if it is desirable to ban child pornography, it should definitely be OK to ban murder.
Yes, the benchmark of “harm caused to another” is arguably the most considerable factor.
However, the common good and prudence are additional, relevant factors. These two explain why Augustine and Aquinas supported the legality of prostitution, even though it means allowing people to indulge their vices and causing harm to the parties involved. They allow it for the sake of the “common good”, which they think would be compromised if prostitution were prohibited by force of law.
“Accordingly in human government also, those who are in authority, rightly tolerate certain evils, lest certain goods be lost, or certain greater evils be incurred: thus Augustine says (De Ordine ii, 4): “If you do away with harlots, the world will be convulsed with lust.” Hence, though unbelievers sin in their rites, they may be tolerated, either on account of some good that ensues therefrom, or because of some evil avoided.”
ST, II-II, Q.10, Art. 11, co.
(Addressing the question “Whether the Rites of Unbelievers Ought to be Tolerated?”)
Essentially, the Augustinian/Thomistic view of prostitution is that is that it serves as an outlet for lust and therefore keeps in under “containment”. If prostitution is altogether eliminated, a disorder of lust will ensue that will lead to greater evils as fulfilment of lustful desires will be sought by other means.
Whether or not they were correct in this assessment, I want to consider the ways in which this line of reasoning relates to abortion.
“Harm” is said in many ways.
Abortion meets the criteria of “causing harm” in the aspect of killing and bodily injury, regardless of the presence or absence of embryonic/fetal pain.
The harm in permitting abortion that prolifers are concerned about, is principally the harm done to the unborn child, secondarily to the mother (whether physical, e.g. impaired fertility, or psychological).
What is the harm in outlawing abortion? Well, the prochoicers are principally concerned with harm to the mother in the form of psychological burden and unwanted health risks associated with the pregnancy. Secondarily, to the child who, they believe, upon birth would not be received well by the mother and who, they think, risks being subjected to a bad maternal environment.
They also think it imposes an obligation on society to “pick up the slack” wherever the biological mother fails.
They think that aborting an unborn child who has a very limited experience of life is preferable to allowing harm done to a born child who is more “aware”.
How does the prolifer respond? Typically with “the end doesn’t justify the means.” But we need to make a compelling case for why. There are people who will flat out reject the notion that there are no cases in which ends justifies the means.