Canmore has a Wellhouse Tower around that area as well as a Crane Cradle.
From its appearance I think the latter looks more likely. St. Margaret's Well must be quite close to being vertically below it, so maybe water was hoisted up with a crane. Supplying the castle with water must have been a problem before the days of steam, since its height would have made a piped water system impossible without mechanical pumps. And since the original road up to the castle from the West Bow was very steep, using water wagons would have been difficult.