Samuel Johnson said this quote

The vanity of being known to be trusted with a secret is generally one of the chief motives to disclose it; for, however absurd it may be thought to boast an honour by an act which shows that it was conferred without merit, yet most men seem rather inclined to confess the want of virtue than of importance.