The phrase 'to hold water' in a literal sense - as in 'this glass will hold water' - has been in use since since the 14th century. In the figurative sense - as in 'your argument won't hold water' - it has been used since the 1600s. In the secondary sense, it obviously suggests that the argument is full of holes, as it were...in other words, not sound.