Sometimes, a court ruling interpreting a statute can lead to horrible consequences, especially when the executive branch (or agency) compounds the problem through indiscriminate enforcement.
Not every real life scenario can be adequately predicted by Congress or the courts, — the latter often presented with a narrow legal question re a narrow set of facts.
Often, Congress creates a platform or structure, but yields enforcement power to the executive agencies, with the expectation that sound discretion will rule the day. That has always been our approach to immigration, giving the executive branch broad discretion.
Unsurprisingly, Trump’s strong anti immigrant views have created an untenable situation that will force Congress and/or the courts to revisit the platform.