You cannot judge what should be applicable in all countries, many countries, where abortion is illegal, are highly religious, and value this religious doctrine above all else. In countries where democracy is the political system of choice, it should be decided democratically, what the majority of the population believe to be right regarding this issue. But to enforce a world law on these populations could potentially be disastrous.
To export your ethical mindset, and believe it to be the only way to see the world, is an obnoxious standpoint and will only lead to hostility and conflict. Many countries are not a member of the International Criminal Court and multiple have stated, antagonistically, that they do not recognise its authority. This includes many powerful nations such as the United States and China, so just as it is difficult to impose bans on certain weapons worldwide without escalating nuclear tensions, it could be both difficult and dangerous to impose a law such as this.
Likewise most territories of the world rank low on the Global Democracy Index, meaning that most states tend to lean more towards that of a dictatorship. These countries may not reflect the beliefs of the people of that country at all, but may be imposed individual beliefs of the ruling elite. This makes these regions less susceptible to adhering to any international law of any kind. Although this may seem a virtuous proposition on paper, it would be difficult to make happen and could have really dire undesired effects and a harsh backlash. States and societies need to come to a position of supporting human rights on their own accord, any efforts to force such things may only lead to conflict.