The Mosaic law for a woman suffering the violent end of her pregnancy covers an exception to the "eye for an eye" principle. This law was not able, nor did it claim, to restore circumstances to their prior state. Rather, it was intended to provide a measure of justice and deterrence.
To requote a more modern translation with a bit more context:
When men fight, and one of them pushes a pregnant woman and a miscarriage results, but no other damage ensues, the one responsible shall be fined according as the woman’s husband may exact from him, the payment to be based on reckoning. But if other damage ensues, the penalty shall be life for life, eye for eye, tooth for tooth, hand for hand, foot for foot, burn for burn, wound for wound, bruise for bruise.—Exodus 21:22-25 (NJPS)
That helps paint the picture a bit better: two men are fighting and one of their wives steps in, perhaps to separate them. If the woman happens to be pregnant and if she miscarries, the offender must pay the husband an appropriate amount of money. The NET Bible explains that the process might have looked something like binding arbitration:
The word בִּפְלִלִים (biflilim) means “with arbitrators.” The point then seems to be that the amount of remuneration for damages that was fixed by the husband had to be approved by the courts. S. R. Driver mentions an alternative to this unusual reading presented by Budde, reading בנפלים as “untimely birth” (Exodus, 219). See also E. A. Speiser, “The Stem PLL in Hebrew,” JBL 82 (1963): 301-6.
But this seems to be an exceptional situation, not the normal case. Usually the penalty for maiming another person in a fight is fixed: "life for life, eye for eye, tooth for tooth, hand for hand, foot for foot, burn for burn, wound for wound, bruise for bruise". That principle, lex talionis, predates Moses and was almost certainly the way such disputes were resolved before the Exodus. A miscarriage is tricky since there's no guarantee the other man has a pregnant wife. The Hammurabi code solved the problem with a fixed payment:
209. If a man strike a free-born woman so that she lose her unborn child, he shall pay ten shekels for her loss.
It also covers the case that the woman dies:
210. If the woman die, his daughter shall be put to death.
In the context of Babylonian law, Mosaic law seems to place a higher value on the life of the unborn, since the fine could be more than ten shekels. It could also be lower if the husband demanded less, of course. It also seems that biblical law put the life of women and men on nearer to equal terms since, as I read it, the man would lose his own life if he killed the woman. Clearly, an equitable punishment was not available when the loss was an unborn child, who was not yet considered a full person.
There is a way out, if you are looking for one. The NET Bible renders the first clause of the verse:
If men fight and hit a pregnant woman and her child is born prematurely,1—Exodus 21:22a (NET)
The footnote reads:
This line has occasioned a good deal of discussion. It may indicate that the child was killed, as in a miscarriage; or it may mean that there was a premature birth. The latter view is taken here because of the way the whole section is written: (1) “her children come out” reflects a birth and not the loss of children, (2) there is no serious damage, and (3) payment is to be set for any remuneration. The word אָסוֹן (’ason) is translated “serious damage.” The word was taken in Mekilta to mean “death.” U. Cassuto says the point of the phrase is that neither the woman or the children that are born die (Exodus, 275). But see among the literature on this: M. G. Kline, “Lex Talionis and the Human Fetus,” JETS 20 (1977): 193-201; W. House, “Miscarriage or Premature Birth: Additional Thoughts on Exodus 21:22-25,” WTJ 41 (1978): 108-23; S. E. Loewenstamm, “Exodus XXI 22-25,” VT 27 (1977): 352-60.
John Calvin, supported the view that the monetary punishment only applied if neither the mother nor the child died on the basis of the clear atrocity of killing the child in their place of safety (the womb) and because it seems unreasonable for a father to set a price on the life of his child.
Jesus quoted the second part of this law:
You have heard that it was said, ‘An eye for an eye and a tooth for a tooth.’ But I say to you, Do not resist the one who is evil. But if anyone slaps you on the right cheek, turn to him the other also. And if anyone would sue you and take your tunic, let him have your cloak as well. And if anyone forces you to go one mile, go with him two miles. Give to the one who begs from you, and do not refuse the one who would borrow from you.—Matthew 5:38-42 (ESV)
In the broader context of Jesus' teaching, one of the purposes of the law was to limit the damage people do to each other when they sin against each other. (See Matthew 19:1-12.) Putting a civil penalty on crimes helped reduce the incidence of private retaliation. Martin Luther King Jr. referenced Exodus 21:22-25 when he said "The old law of an eye for an eye leaves everyone blind." But that overstates the case, since the purpose of the law seemed to be to stop the cycle of revenge that began in Genesis 4. Rather than allowing exponentially increasing violence, the law set a reasonable upper limit on punishment.
In this case, since the life of the child was irrevocably lost, the law lacked the power to restore the loss. Only God can redeem the situation. God didn't provide the law to accomplish that purpose, but to govern human interaction at a gross level.