Lawyers and justices spent much of the hearing discussing whether the group that brought the challenge had legal standing.