I don't know how it is justified, but other localities have done it with police and firefighters as well.
If a smoker, woman or elderly person is physically unable to perform the job, then they should not be hired. However, since every individual is different, this should be determined by a standardized test which is applied to all employees.
The rules and laws for Government employment is, and must be different from a privatly owned business.
Well, with firefighters, there's a little different situation. When a firefighter sues the city and department when he gets lung cancer after 25 years on the job, the city doesn't want to get sued for a workplace related hazard if the cancer actually came from smoking.