Yes,I know how crazy this sounds and I'd like to say this is simply a theory I came up with while watching LaFleur this morning, so bare with me for a moment.
So, we don't know who built the well. It could have been the Dharma Initiative, the Others, or some other group of people. All we know is that the Frozen Donkey Wheel is at the bottom of it and it was filled in sometime before 1974. This theory is based off Daniel's idea of 'whatever happened, happened'. When Locke was climbing down the well to turn the Donkey Wheel there was a flash, Sawyer grabbed the rope to make sure Locke didn't fall. After the flash they were transported to sometime before the well was built, but the rope came with them. Sawyer then dropped the rope and Locke moved the Island, sending them all to 1974.
So, after that sequence of events, the rope from the well ended up sometime before the well had even been built. What if, whoever it was that built the well, found the rope, found out what was at the other end of it, and then built the well around it? This would explain why the well was even built in the first place. Perhaps it was all because of Sawyer that the Frozen Donkey Wheel was discovered in the first place.