I see from Wiktionary that it was originally a legal concept, expressed in medieval Latin.
https://en.wiktionary.org/wiki/exception_that_proves_the_rul...
Just as you say, the point is that a rule is implied by a specific exception, as in the example "free entry on Sundays", which implies the unstated rule "pay for entry on other days".
The exception weakens the rule, it's true, but may also reveal the rule.