Courts classify challenges to a law's constitutionality into facial challenges (unconstitutional for everyone) and as-applied (unconstitutional for only the plaintiff/petitioner/appellant/whatever). A facial challenge seeks to invalidate the entire law. An as-applied challenge seeks to narrow its scope, generally because the law is vague or too broad.
In this case, the court didn't find it unconstitutional to prohibit foreign nationals in general from possessing firearms, because "the people" in the Constitution is generally interpreted as people who participate in the politics of the US (typically voting or running for office, but certainly could include speaking in public) and are not actively trying to destroy US civilization (e.g., violent criminals or hostile foreign agents). Nevertheless, the 2A rights of documented permanent residents are protected, since they are not prohibited from acquiring and possessing firearms. Although Carbajal-Flores is not classified as a permanent resident under federal immigration law, he has resided in the US for many years and intends to stay. Throughout his time here, he has been employed and has obeyed all other laws. In 1791 (in fact up until the 20th century), that would have been sufficient.
At the district level, the "as-applied" ruling really does apply to only Carbajal-Flores. If the federal government appeals it to CA7 and loses (i.e., CA7 affirms the district ruling), then it narrows the scope of GCA 1968 for all undocumented immigrants in Illinois, Indiana, and Wisconsin. It creates an interesting situation. Undocumented immigrants still aren't going to be able to purchase firearms legally, since they won't pass a NICS check, but they also wouldn't be able to be prosecuted federally for merely possessing a firearm.
It leaves it on shakier grounds. If undocumented immigrants cannot be prosecuted for federal weapons charges, it doesn't mean they cannot be prosecuted for state weapons charges. But if any state can prosecute someone for constitutionally protected conduct, it points out that the state law is federally unconstitutional. IMO the more arguments we have against the FOID, the better.