It is legal IF you actually owed money for health insurance which had not previously been taken out of your pay--that is, if you had not paid your employee portion of a health insurance premium. It is not legal if you had paid all amounts you were responsible for.