Enforcing a company policy is legal. Selectively enforcing it based on race may not be.
Take your evidence of selective enforcement based on race to a local attorney to review and investigatie
They key here is that "everyone in my department has replaced tools." If that is true, why were you fired for doing this. You should file a claim with the Equal Employment Opportunity Commission if the company has more than 15 employees. You might have been the victim of discrimination.
This response does not create a lawyer client relationship. Each case is determined on its specific facts and this reply is intended for a general audience and facts particular to your case may affect the answer. Consult with an attorney in person for specific answers to your questions.
The prior answers are correct, you may have a discrimination claim. It depends on evidence showing the reason you were treated differently was because of your ethnicity. You may also have rights based on a union contract or policy manual providing for progressive discipline -- it is worth giving a call to an employment lawyer.