The snake might be going into shed. The cloudiness of their eyes reduce their vision and makes the snake vulnerable and more aggressive.
The snake might be gravid (pregnant) and it makes them very defensive the closer they get to laying their eggs.
The snake might be in some sort of pain. Inspect the snake for any signs of damage, be it on the surface of the body or a potential kink in the spine (may be from a fracture or broken bones)
There might be an outside issue such as the constant presence of a cat or dog. The snake will then remain defensive assuming the cat or dog is a preditor.