The Church has a teaching on the matter, and it is covered under the Principle of Double Effect.
Actually, the Church does not have a teaching on this, but there is a common theological argument that is often taught in Catholic schools, etc.
The bishop’s guidelines for caregivers:
usccb.org/issues-and-action/human-life-and-dignity/health-care/upload/Ethical-Religious-Directives-Catholic-Health-Care-Services-fifth-edition-2009.pdf
Give no allowance for direct abortion and only a narrow allowance for double effect.
I generally don’t quote the Catholic Encyclopedia, but the entry on Abortion does have a section which is historically accurate:
The teachings of the Catholic Church admit of no doubt on the subject. Such moral questions, when they are submitted, are decided by the Tribunal of the Holy Office. Now this authority decreed, 28 May, 1884, and again, 18 August, 1889, that “it cannot be safely taught in Catholic schools that it is lawful to perform . . . any surgical operation which is directly destructive of the life of the fetus or the mother.” Abortion was condemned by name, 24 July, 1895, in answer to the question whether when the mother is in immediate danger of death and there is no other means of saving her life, a physician can with a safe conscience cause abortion not by destroying the child in the womb (which was explicitly condemned in the former decree), but by giving it a chance to be born alive, though not being yet viable, it would soon expire. The answer was that he cannot. After these and other similar decisions had been given, some moralists thought they saw reasons to doubt whether an exception might not be allowed in the case of ectopic gestations. Therefore the question was submitted: “Is it ever allowed to extract from the body of the mother ectopic embryos still immature, before the sixth month after conception is completed?” The answer given, 20 March, 1902, was: “No; according to the decree of 4 May, 1898; according to which, as far as possible, earnest and opportune provision is to be made to safeguard the life of the child and of the mother. As to the time, let the questioner remember that no acceleration of birth is licit unless it be done at a time, and in ways in which, according to the usual course of things, the life of the mother and the child be provided for”. Ethics, then, and the Church agree in teaching that no action is lawful which directly destroys fetal life. It is also clear that extracting the living fetus before it is viable, is destroying its life as directly as it would be killing a grown man directly to plunge him into a medium in which he cannot live, and hold him there till he expires.
newadvent.org/cathen/01046b.htm
Something that was commonly taught through the 20th century in Catholic schools is that there is a moral distinction between salpingectomy and salpingostomy. That is, between surgically removing the fetus and attempting to save the tube and removing a section of the tube. The idea is that if you simply remove the section of tube, you can pretend that there might not be an embryo in there so it’s death is by double effect.
The doctor who first postulated this conceded that it is a very, “hair thin” distinction. It has never been universally accepted by theologians, and it has never been directly taught by the Magisterium.
In fact, in 2008 Rome issued a doctrinal note arguing against common arguments of double effect and the human embryo, though ectopic pregnancy was not directly addressed:
vatican.va/roman_curia/congregations/cfaith/documents/rc_con_cfaith_doc_20081208_dignitas-personae_en.html
The big problem with the old embryo removal vs. tubal ligation argument is that medical care has advanced. When the distinction was first made, the situation generally only arose after internal bleeding was occurring and surgery was already inevitable. Tubal repair had a very low probability of success, so the impact on maternal health for observing the distinction was small. Also, without opening the tube, there was some doubt if, in fact, an ectopic pregnancy was the root cause.
In modern medicine ectopic pregnancies can be detected numerous ways, even prior to hemorrhaging. We also now have plasma and antibiotics, which lower the odds of maternal death. So double effect is challenged in two ways, it is no longer a balance of risks between the two patients, and the surgeon generally knows, with certainty, that an embryo is present.
This has created a fairly fierce theological debate. If you go to the NCBC, which I see was linked above and simply search for “ectopic” you will get a glimpse that multiple points of view are now often presented (the link is a single point of view, not a policy position from the NCBC). Many articles are only available to members, but some cover things like a group of Catholic hospitals protocol for using methodrexate for ectopic pregnancies. It involves fairly advanced imaging technology to confirm that certain key structures are now absent from the embryo, similar to common tests to determine when organ donation is licit. Then MTX is administered. The advantage to the mother is that there is no surgery and no sterilization (which is also generally a sin).
I am not arguing for any particular theological interpretation or medical course. I am simply noting that this is a tragic situation, which seems to be rising because of environmental factors, not specific behaviors by individual women. Decisions should be made by women with the help of their families, doctors, and their pastors. Both the women and their short lived offspring, should have our prayers.