Some people claim the Bible actually endorses abortion. They allege that Num 5 is a recipe for an abortifacient.
i) One hermeneutical challenge is that Num 5 contains some obscure terminology. For that reason alone, it's very precarious to make this a prooftext for abortion.
ii) Even apart from the semantic issues, this is not a ritual for pregnant women in particular, but for suspected wives in general. Whether or not the woman happens to be pregnant is incidental to the ritual. The point of the ritual is to establish guilt or innocence, and penalize guilt.
iii) In Scripture, barrenness is sometimes (but by no means always) a penalty for sin. It would be consistent with that theme if the punishment in Num 5 is infertility.
iv) Some critics will complain that the ritual is sexist or misogynistic. By way of reply:
a) In the Mosaic law, adultery was a capital offense for adulterer and adulteress alike (Lev 20:10; Deut 22:22).
b) In Lev 20:20-21, childlessness is a penalty for incest. Apparently, God will curse the incestuous couple with infertility. They will be unable to reproduce. Presumably, they will outlive any children they may already have.
c) In traditional cultures, adultery is an offense against the husband. She has shamed him. And it's up to him to restore his honor.
In the OT, by contrast, adultery is primarily a religious offense. A question of how men and women conduct their lives in the sight of God. Whether they lead God-honoring or God-dishonoring lives.
Hence, trial by ordeal (Num 5) takes the case out of the husband's hands. A wife, falsely accused, has been dishonored by the accuser (her husband). If innocent, the rite restores her honor. The efficacy of the rite is contingent on God's will.
v) Here's a good discussion of the terminology:
The priest himself holds the vessel which contains the "water of bitterness." There has been much debate regarding the meaning of the term "bitterness" here. The Septuagint translates it as "waters of testing" or "proof," and, of course, that makes good sense in the context. This reading has been supported by G. R. Driver. Snaith, using Arabic cognates, suggests that it may mean to "cause an abortion." There is no support from the Hebrew language for such a reading. Pardee argues that it may mean "curse-bringing," and he bases his translation on an Ugartic textual parallel. Brichto takes an entirely different approach by saying it means "instruction, revelation."
Sasson has taken a unique approach to the issue. He argues on the basis of an Ugaritic cognate, that the term translated above as "bitterness" actually means "blessing." Thus, in his view, the closing of v18 is really a merismus, which reads, "waters which bless and bring the curse." In other words, the judgment is still in doubt, and the outcome will depend on her guilt or innocence with regard to the test.
In these verses the priest administers an oath-taking ceremony. If she is innocent, then may she "be free" from a curse…If, on the other hand, she is guilty of committing adultery, may she receive the "oath of the curse." The term for "curse" here is used of an imprecation that is added on to an oath. Thus, the woman is calling down punishment on herself if she is indeed guilty of the crime.
The specific punishment is that Yahweh will cause her "thigh to sag" and her "belly to swell up."
What is meant by these two physical ailments is uncertain…The ailments probably, in a sense of ironic justice, prohibit the act of procreation. The "thigh" is commonly used to refer to sexual organs, particularly in regard to the male (see Gen 46:26, KJV).
Distending of the belly is more difficult to interpret. Frymer-Kensky has offered a reasonable solution. She argues that the verb "to swell up" (of which this is the only occurrence in Hebrew) is related to the Akkadian verb "to flood." And, thus, the woman's uterus is directly flooded by the curse-bearing waters. She is not able to have intercourse, to conceive, or to bear children. J. Currid, Numbers (EP 2009), 93-96.