In the episode Because You Left, Locke is shot in the leg while trying to climb up to the drug smuggler's plane right after seeing it crash. This happens while the Island is skipping through time. I think that for the short period of time while Locke had the bullet in his leg, the pain somehow connected with him going to the plane for the first time.
The open question on the episode's page does not question whether it was the island who took away his ability or not, but just why it did. That's why I think the answer to that question is so obvious that I would actually suggest the question to be removed, because it is resolved at the end of the episode when the plane falls, or when it is revealed that Boone died. "The island" wanted Locke to find the plane, to open the hatch etc., that's what it's all about, leading Locke to his "destiny". But, as the plane would fall and whoever was in it die, Locke could not be allowed to climb up there. If he was able to, he surely would have climbed up there, and it would have been Locke that died, and he never would have fulfilled whatever was in store for him. Anamon 23:13, 7 February 2009 (UTC)
A medical understanding of why Locke lost the ability to walk is conversion disorder. Conversion disorder is a psychiatric diagnosis that refers to the loss of a neurologic function or another neurologic symptom such as seizures that is not due to another neurological disease and is caused by a stressful situation. The patient is not merely making up the symptoms; they are real, but they aren't from a neurological diagnosis. According to this theory, Locke's initial failure to notice the shrapnel in his leg could be due to the situation. The anticipation of getting into the hatch with the jimmy-rigged trebuchet caused increased levels of epinephrine, cortisol and other hormones. Realizing he hadnt noticed the shrapnel caused him to consider that he might lose his newfound strength to his legs. This caused a great deal of stress and brought on the conversion disorder - further lack of feeling and strength in the lower extremities. The sudden accident of Boone falling from the cliff then snapped his brain out of the conversion disorder so that he was able to carry Boone back to Jack. The constant play between science and faith begs for a scientific understanding of what was happening with Locke at this point.