Yes, an employer can fire you for pending charges. This is because, in most states, a company can terminate you for no reason, meaning if they discover you have pending criminal charges, they can legally dismiss you if they choose to do so.
However, if you can prove some sort of discrimination on behalf of your employer, you might have legal rights in this situation.
Employers can terminate you for pending charges because of at-will employment. This is an agreement between an employer and an employee that a worker may be terminated or dismissed for any reason without reasoning, warning, or explanation.
Most at-will employees are required to sign documents stating their knowledge of this fact. This protects employers from potential lawsuits for an unjustified firing of an employee.
Employees might have legal recourse if they feel they have been terminated due to discrimination. In this scenario, an employee should seek counsel and possible representation from an employment lawyer or attorney familiar with employment law.