The story
Perhaps because a stream of water falling approximately three feet from a water pump into a bucket is both straight and thin; but compare also yard of ale, where the yard is a tall, slender, hollow receptacle.
Etymology from Wiktionary, CC BY-SA 4.0.