In the episode where Eko dies, "The Cost of Living" in Season 3, Locke finds out that Eko has seen the Monster. Locke tells him that he's seen it too: "It was a very bright light. It was beautiful." And similarly he tells check in the Season 1 episode "White Rabbit", "I've looked into the eye of this island and what I saw was beautiful."
So that suggests that Locke was blinded by the Monster's flash of light, which it produces when it encounters someone for the first time, in order to "scan" them to determine their character and memories. (Jacob and the Man in Black have a long-running contest to see whether humans are always corruptible because it is in their very nature to sin, or whether it doesn't have to "always end the same way. So when new people come to the island, the monster judges them; if they're beyond redemption he kills them, otherwise he tries to manipulate and corrupt them to prove that he's right. But Jack ultimately proves that Jacob is right about the fundamental goodness of Man, by being willing to sacrifice himself for the sake of the Island.)