They wrote the legislation to be completely unable to accomplish those ends because the legislation was so filled with crap from multiple people with multiple objectives. The purpose of the Supreme Court is not to modify the text of the law to make it work. If the text of the law is wrong, it is the responsibility of the legislature to modify the text of the law through the legislative process.
However, for this law, it was passed in such a clusterfuck of a hurry that they didn't read the law first and ask these questions about how it would work in practice. Now they don't have the legislative numbers to fix it the right way and the POTUS has put public and political pressure on the SCOTUS to interpret the law with the intent of saving the implementation instead of interpreting the law based on the law.