Yes, it is legal: there is no law requiring an employer to hire any given person, and they can put anyone they like on a "no hire" list for any reason--and if they do, then it is legal to tell others about that, since it is legal or permissible to tell the truth to prospective employers about your relationship with an ex- or former employee. Also, having an eye infection does not legally allow you to miss work, even with doctors' notes (a doctor's note has no legal power over your employer) unless you had and used paid time off you'd earned (like sick leave) for the absence or were eligible for and used FMLA leave, so it's not even a lie to say you failed to finish out the 2 weeks in this case, since the eye infection would not have made it ok to do so (unless you used sick leave, etc.).