The state’s highest court has rejected a challenge to the restrictive abortion law brought by more than 20 women, all of whom had faced serious medical complications with their pregnancies.