The court also rejected a law that prohibits the sale of abortion pills.