They had standing, otherwise a ruling would not have been given. As for your belief that there is no way Cruz could lose, is just that your belief. Not knocking your belief but it is just not reality. A higher Court could then overrule this judge. Cruz could appeal and get a positive ruling. Hillary would take it all the way to the Supreme Court, rest assured. With the makeup of the Supreme Court no one knows what the outcome may be. If the Republicans confirm Merrick Garland then we can almost be assured of a positive outcome for Hillary.
If Ted is VP, the arguments against him would be in the hypothetical.