It is fair if it is relevant to the job. If the legitimate requirements of a job happen to negatively affect a sector of the population that's not necessarily a problem (think firefighters being able to move a certain amount of weight in a certain amount of time). If it's completely arbitrary - everyone needs to be clean-shaven every day - and disproportionately affects a certain protected class, you could have issues.