The ruling was quickly challenged by the pill’s manufacturer, setting up a battle at the Supreme Court