Just as humans get eye infections (pink eye), animals can get it too. That would take some medication to clear it up. Or he may have an injury to the eye. Look around his cage and see if there's anything that may have scratched or poked him in the eye. That may clear up on its own but there's a chance of infection too. Either way, it might be best to see a vet about some eye ointment for him.
I read that hay and alfalfa bedding can poke hamsters eyes and hurt them because the stems are pokey on the end. If you have been useing these for bedding or treats maybe this could have hurt your hammie.