Your question is woefully deficient on details, because the base question is if what had happened to you was fair or not.
This unsurprisingly depends on your employment status, who you were actually employed by, and what state you live in.
As an independent contractor on a standard 1099 contract, you are NOT an employee of the Company, but you are an independent entity of the company where you agree to perform requested services for an agreed upon compensation. In this contract, both parties have the right to terminate it going forward for no reason at all.
As an employee of a consultant company or recruiting agency you would be considered an employee that happens to be performing work at a company per the instructions and agreements by your employer and this company. If the company doesn't want you back then you may not be working and not getting paid, however you would still be considered an employee of the agency and they would be responsible for finding additional work for you.
As an employee of the Company you will get a W2 but the employer will have certain rules and ways that they should go about things when it comes to termination. What these worker protections are depend highly on what state you live in.
IANAL: Nearly all states operate under At-Will employment laws. Under these there are various protections to workers being fired for what is widely considered unfair reasons. Of these common statutory unfair reasons are:
for refusing to commit illegal acts – An employer is not permitted to fire an employee because the employee refuses to commit an act that is illegal.
family or medical leave – federal law permits most employees to take a leave of absence for specific family or medical problems. An employer is not permitted to fire an employee who takes family or medical leave for a reason outlined in the Family and Medical Leave Act.
not following own termination procedures – often, the employee handbook or company policy outlines a procedure that must be followed before an employee is terminated. If the employer fires an employee without following this procedure, the employee may have a claim for wrongful termination.
Most states have clauses offering additional protections to workers under Public Policy Doctrine. What this means is that an employer cannot terminate you for retaliation of actions that comply with public policy. An example of this would be if you reported your employer to the EPA for illegally disposing of toxic or regulated waste and you were let go because of it. You would have a strong case to bring suit.
The bottom line is that despite all of this, determining wrongful termination is incredibly difficult to do, as most employers realize that they can best protect themselves legally by almost never terminating an employee with reason. If they simply say that your services are no longer needed, then in most cases it is far too dificult to prove wrongful dismissal on the basis of race, gender, discrimination, or retaliation.
So you have to determine yourself if you feel that what your employer did was illegal, because coming to a conclusion on unethical is far harder to prove. Certainly illegal is unethical, but unethical isn't always illegal.