The literal sense of the expression “to hold water”, such as applied to a sound pitcher or bowl, gradually acquired in the early seventeenth century a figurative meaning, as if testing a pitcher for soundness by filling it with water, if unsound, the water would leak out.
Thus, figuratively, an unsound argument or fallacious reasoning would not “hold water” if it failed to stand a test.