The Supreme Court ruling comes after Israel said it would ban 37 aid groups from Gaza for failing to follow new rules.