There actually was nothing wrong with the first ban. The statue gives the President nearly unlimited discretion as to whom he chooses to allow to enter the country.
Exactly. It is up to the executive to enact the laws. If the court finds the law in question wrong, it can strike down the law, but it cannot bind the executive.