You are correct that the Declaration of Independence is not law, but it ssays among these rights...
The constitution does not apply only to citizens. Would you deny a permanent legal resident the right to free speech or exercise of religion (or not)? Would you quarter soldiers in their home because they have not yet taken the oath of citizenship? My family came from Germany in the 1890s. Should they have not been able to get a gun to hunt for food until they became a citizen?
ETA: Unlawful activity would negate certain rights as it does for citizens, but due process would still exist. If guilty, kick their ass out.
Maybe nonresident aliens should not be allowed guns in the US, but that is not the law as it is currently written. The student in question obtained a gun under this part of the firearms code:
An alien admitted to the United States under a nonimmigrant visa is prohibited from shipping, transporting, receiving, or possessing a firearm or ammunition unless the alien falls within one of the exceptions provided in 18 U.S.C. 922(y)(2), such as: a valid hunting license or permit, admitted for lawful hunting or sporting purposes, certain official representatives of a foreign government, or a foreign law enforcement officer of a friendly foreign government entering the United States on official law enforcement business