I suppose it is the same as enforcing a dress code for employees and I think employers should be able to enforce that.
It's just too bad that a (as far as we know) good employee is lost over this.
Because the company changed the rules. They are allowed to do that.