In Western countries, abortion was largely restricted until the early 20th century. In 1920, Lenin legalized abortion in the entire Soviet Union. In 1931, Abortion was legalized in Mexico for the first time in the case of rape. The first western country to legalize abortion for medical purposes was Iceland around 1935.
The legalization of abortion grew partly out of a growing concern for population control. This was inspired by the ideas of Thomas Malthus who believed that as the population increased, there would be a point where increases in food production would not match population growth leading to starvation, wars, and social breakdown.
Population control, was as a result, seen as away to prevent catastrophe. It was also promoted by eugenicists who wanted to control who was born ad contributing to the gene pool. Abortion was still illegal or frowned upon in most countries until after the mid-20th century.