I've been scratching my head over this topic, so I did a search, and it turns out a "tale of a tub" was 1) overall, a 17-18th cent. term for a cock-and-bull story; 2) the name of a play by Ben Johnson (1633); and 3) the name of an allegorical satire about politico-religious excess, penned by Jonathan Swift (pub. 1704). Of the three, it is Swift's work that presents the tub-and-whale image. The book was enormously popular in its day, yet it's also been called a brilliant failure. It is difficult reading, and some would say his best work, but because it was largely misunderstood, it put him in bad odor with the powers that be.
https://en.wikipedia.org/wiki/A_Tale_of_a_Tub"Swift's explanation for the title of the book is that the Ship of State was threatened by a whale (specifically, the Leviathan of Thomas Hobbes) and the new political societies (the Rota Club is mentioned). His book is intended to be a tub that the sailors of state (the nobles and ministers) might toss over the side to divert the attention of the beast (those who questioned the government and its right to rule)." (Wiki)
Here's a transcript of the 1889 edition if anyone cares to have a look:
https://www.gutenberg.org/files/4737/4737-h/4737-h.htmIn that edition's preface (page 49!), Swift called his book a "tub" (of nonsense?) to distract the "whale", but in the book the "tub" is also a metaphor for the pulpit, so especially in light of the book already being called a cock-and-bull story, separating the two tubs is probably a fool's errand. What I'm getting out of my first glance is that it suggests this: Troubled by Hobbes and ilk? Throw religion-as-politics at 'em. If nothing else, it'll keep them occupied. Swift's personal "tub" - the book, and his bully pulpit - provides tongue-in-cheek serving suggestions, as it were. But again, this is just at first glance. I'd probably use the book as a shelter-in-place distraction for my own allegorical COVID whale, but I already have C&F to occupy me plenty, especially when, like this, I have to make heads or tails out of things you lot throw at me.
I did some more searching and I can only conclude that Swift, and Swift alone, cooked up the eccentric notion of sailors reportedly tossing a tub at a whale to distract it, for I find it nowhere else; utterly fanciful stuff was Swift's stock in trade when pointing out what he saw as folly. From the preface:
"To this end, at a grand committee, some days ago, this important discovery was made by a certain curious and refined observer [given all the hyperbole, I lay odds the "refined observer" who made the "important discovery" at a "grand committee" was none other than Swift himself setting it all up

], that seamen have a custom when they meet a Whale to fling him out an empty Tub, by way of amusement, to divert him from laying violent hands upon the Ship. This parable was immediately mythologised; the Whale was interpreted to be Hobbes’s “Leviathan,” which tosses and plays with all other schemes of religion and government, whereof a great many are hollow, and dry, and empty, and noisy, and wooden, and given to rotation."
Ouch.
