My question involves labor and employment law for the state of: North Dakota

I was terminated by my staffing agency 2month into a 6month contract.
Reason: The company wanted US citizens on the job. I am a Legal Permanent Resident.
I understand this requirement is not uncommon.
If the staffing agency hired me and 2 other employees having knowledge of this requirement in the contract they had with the company before hiring me, and, only used us to fill quotas so as to hold those spots, is it legal?
I believe they must have had candidate requirement from the company which might have explicitly mention citizenship status needed for the job as it is a sub contract govt job. They probably wanted to clinch some spots for themselves as there were people from other staffing agencies there as well. When the company found out they had no choice than to terminate.