The king, in an attempt to find this well, issues a proclamation, that whoever finds this place to drill will own all of the water that comes out of it for the rest of their lives.
Most of the desert dwellers recognize that searching for this well wont keep them fed in the meantime, so an enterprising young duke offers a different deal. He says that he will pay people to search for the well, in exchange for the rights to the water if they find it.
Many desert dwellers take him up on this deal, its a good job, and it pays well enough to subsidize the searching.
When the well is finally found, the king grudgingly hands the duke the rights to the water, and with the wealth that the exorbitant prices he charges for water brings him, the duke eventually owns the whole desert and deposes the king.
That's it, thats the whole story. If you thought it was stupid, and that the king should have done things differently, we are in agreement.