Is it legal to fire one employee but not another for the same breech of company policy?
Firing some but not all employees committing the same offense is risky because the employees who were terminated may have grounds for claiming the company discriminated against them in some way.
For example, if the employee not terminated is male, but those fired were all females; or if the employee not fired is young, but those fired were over the age of 40; or if the employee not fired is one ethnic or racial background or religion, while those fired are all of an another background.
So to answer your question, laws against discrimination may have been broken or may at least appear to have been. In that case, the employees fired can bring a claim against the company either severally or jointly if they wish to do so through the EEOC.
What this really is, regardless, is a very poor management practice. Employees want to be in an environment in which they are certain that fair treatment is the general rule. In this situation, morale is negatively affected, I am sure, by this course of action.