An eyesore is a structure that is displeasing, aesthetically.  A sore eye is an unpleasant condition (of human health).