Let me say first that I am a devout Catholic. And that abortion is contrary to all Catholic teaching. However, it was not always clear when the Church believed a child had a soul. Popes may have fallen into placing credence in Thomistic teachings, but I agree that abortion was not deemed to have been freed from it's distinction as a sin.
St. Augustine (354-430 CE) reversed centuries of Christian teaching in Western Europe, and returned to the Aristotelian concept of "delayed ensoulment." He wrote 7 that a human soul cannot live in an unformed body. Thus, early in pregnancy, an abortion is not murder because no soul is destroyed (or, more accurately, only a vegetable or animal soul is terminated). He wrote extensively on sexual matters, teaching that the original sin of Adam and Eve are passed to each successive generation through the pleasure generated during sexual intercourse. This passed into the church's canon law. Only abortion of a more fully developed "fetus animatus" (animated fetus) was punished as murder.
St. Jerome wrote in a letter to Aglasia: "The seed gradually takes shape in the uterus, and it [abortion] does not count as killing until the individual elements have acquired their external appearance and their limbs"
Pope Innocent III (?-1216) wrote a letter which ruled on a case of a Carthusian monk who had arranged for his female lover to obtain an abortion. The Pope decided that the monk was not guilty of homicide if the fetus was not "animated."
Early in the 13th century, Pope Innocent III stated that the soul enters the body of the fetus at the time of "quickening" - when the woman first feels movement of the fetus. After ensoulment, abortion was equated with murder; before that time, it was a less serious sin, because it terminated only potential human life, not human life.
St. Thomas Aquinas (1225-1274) also considered only the abortion of an "animated" fetus as murder.
Pope Sixtus V issued a Papal bull "Effraenatam" in 1588 which threatened those who carried out abortions at any stage of gestation with excommunication and the death penalty. Pope Gregory XIV revoked the Papal bull shortly after taking office in 1591. He reinstated the "quickening" test, which he said happened 116 days into pregnancy (16½ weeks).
It was Pope Pius IX who reversed the stance of the Roman Catholic church once more. He dropped the distinction between the "fetus animatus" and "fetus inanimatus" in 1869. Canon law was revised in 1917 and 1983 and to refer simply to "the fetus." The tolerant approach to abortion which had prevailed in the Roman Catholic Church for centuries ended. The church requires excommunication for abortions at any stage of pregnancy.