The phrase "fail spectacularly" is significantly less common in Google Books search results than the phrase "spectacular failure," as this Ngram chart for the period 1860–2005 indicates:
In addition, the earliest match for "fail spectacularly" that I could find in a series of publishing database was from 1906, almost three decades after the first match for "spectacular failure" (1878).
Neither phrase has an outstanding early occurrence that would account for its subsequent fairly widespread use. Here is a look at early instances of each phrase.
The three earliest matches I obtained in database searches are from 1906, 1915, and 1920. From Henry, Fuller, "Addolarata's Intervention," in Scribner's Magazine (December 1906):
I say this despite the obvious failure of "The Grand Master." But why should I employ the words "obvious" and "failure"? For the book no more reached the public consciousness than a snowflake falling into Vesuvius reaches the earth. "Youth Must Have Its Fling," on the contrary, did fail—spectacularly, resonantly. After its first grand flare it flickered before diminishing hundreds for a fortnight, and then it flickered out. Its passing was notorious. They knew about it in Syracuse and Detroit and Atlanta and Denver. The daily papers had their gibes about it; weeklies with "theatrical departments" gave it a cut as it hastened don the dark corridor of failure; and long afterward belated monthlies were busily explaining why the wreck had come about and acutely speculating on the dazed young author's future.
From "Soon Said," in The Fruit Grower and Farmer (March 1, 1915):
The standard of values is not silver and not gold—it's a square meal.
It does seem that a lot of people would rather fail spectacularly than to make a moderate success.
Some farmers are always surprised when the planting season comes.
And from Ethel Kelley, Outside Inn (1920):
"Well, they've sowed 'em, haven't they?"
"Not by a long shot. That's the trouble,—they don't get any forrider, from our point of view. I thought it would be the best policy to stand by and let Nancy work it out. I thought her restaurant would either fail spectacularly in a month, or succeed brilliantly and she'd make over the executive end of it to somebody else. I never thought of her buckling down like this, and wearing herself out at it."
This phrase appears multiple times in the nineteenth century, with newspaper matches from as early as 1878. From "Mr. Creswick as Richard III," in the Sydney [New South Wales] Morning Herald (April 8, 1878):
Of all the plays that Shakspeare ever wrote, none has suffered such tomahawking at the hands of modern playwrights and tragedians as the one under notice. In its original form it is almost unactable, not so much from its great length, but because it introduces scenes which though they are attempted on the modern stage, are ordinarily provocative of more mirth than solemnity. The play being as a rule an utter spectacular failure, has this particular demerit, in its condensed condition, that it hurries the dialogue and through excisions barely leads, by means of the latter, sufficiently up to the situation.
From "Gifford Over-Confident: And Some Other Republican Likely to Be Nominated for Delegate" in the St. Paul [Minnesota] Daily Globe (July 24, 1886):
There is only one idea, one ambition shared by those who are not already favoring Gifford, and that is to down him at any and all hazards. The Harrison Allen boom was what might be called a spectacular failure—a fizzle so pronounced as to lead many to believe that he was never in the field.
From "Unzer Fritz's Throat," in the New York Tribune (November 11, 1887):
The rain proved a bad showman yesterday but a good policeman. The Lord Mayor's procession was a spectacular failure, and the plans of the roughs for a row were also failures. There was no disturbance and not a blow was struck. Sir Charles Warren's preparations were on a scale hardly less discouraging than the rain to rowdy enthusiasm.
From "Bleak Weather in Chicago," in the New York Tribune (April 29, 1893):
How, indeed, can the opening of a great summer outdoor fair be made impressive when the participants in the ceremonies, wearing overshoes and mackintoshes, and huddled under a roof for shelter, look shivering out, not on trim lawns and parking, but on a wide expanse of mud and rain-flooded turf? The opening day of the Fair is likely to prove a spectacular failure, for the same reason that Inauguration Day is, except except on rare occasions, a miserable day of suffering at the National capital, it being as sheer folly to expect favoring conditions for an inauguration pageant in Washington in early March as it is to look for appropriate weather for outdoor displays in New-York and Chicago at the end of April.
From "Why Bryan Failed," in The Nation (August 20, 1896):
But the greatest difference, after all, and the truest reason of Mr. Bryan's downfall, is the fact that Lincoln could appeal to the patriotic instinct an the sense of national honor, while his foolish young imitator has to argue for the cause of private dishonesty and public disgrace. That cause would be desperate in the hands of [Daniel] Webster himself, if we can perceive his piercing mind caught for an instant by the free-silver sophistries. In Mr. Bryan's hands, the case becomes not only desperate but ridiculous. It is our great salvation that the free-silver logic is such a mass of absurdities and self-contradictions. It is our great good fortune that these have all been so stupidly collected and fathered by Mr. Bryan. A giant in dialectics, the most skillful adept in making the worse appear the better reason, could not argue the free-silver cause in a way to stand secure against the battering of three months' discussion before the American people. The Boy Orator has not only uncovered its and his own nakedness, but has made it and himself an object of mirth to all the people. American humor casts an enormous vote, and Mr. Bryan's spectacular failure has arrayed it solidly against his candidacy.
From "Local and General Items," in the Kiama [Queensland] Independent (August 25, 1896):
An eclipse of the moon was billed for Sunday evening; but it was a spectacular failure. For a few moments shortly after six o'clock, a semi-obscuration of the moon's surface was noticeable, but 'it was scarcely more than what might be phrased a "shadow of an eclipse." Mr. Russell, the Government Astronomer, told a reporter on Sunday night that the eclipse did not belong to this hemisphere at all; it was the property of the northern portion of the globe. No official cognisance had been taken of the phenomenon by the Observatory.
And from "Pen Thrusts at Weyler" in the Omaha [Nebraska] Daily Bee (November 25, 1896):
Philadelphia Press: The manifest difficulty with Butcher Weyler is not his failure to capture Maceo, but his inability to recognize the fact that he is the meat glittering and spectacular failure as an alleged soldier that has been seen in the new world since the first days of Spanish occupation.
In many of these early instances, it is possible (and in some cases, such as the 1896 eclipse story, necessary) to read "spectacular failure" as meaning not "extraordinary and disastrous failure" but "failure as a public spectacle." But the two U.S. examples from 1896 illustrate the emergence of "spectacular failure" in the sense of "high-profile fiasco." Similar instances appear in the very early 1900s, such as this excerpt from "Moore Brothers, Controlling the Rock Island, Grew Rich After Fortune Failed Them" the St. Louis [Missouri] Republic (May 4, 1902):
SPECTACULAR FAILURE OF THE MOORE BROTHERS.
The failure of the Moores was one of the most spectacular that has occurred in this country in many years, and the financial survival of the brothers is quite remarkable, and is considered by financiers as the greatest recovery ever known in that length of time.
The turn of the century is the period immediately before instances of "fail spectacularly" begin to appear in publishing databases that are searchable online
It seems likely that "fail spectacularly" in the sense of "suffer a conspicuous, ignominious, and unmitigated disaster" arose out of the earlier phrase "spectacular failure," which underwent a significant transformation in meaning toward the end of the nineteenth century. Early instances of "spectacular failure" use the phrase primarily in the sense of "an event or performance that is a failure as a spectacle"—that is, as a thing to be seen (often by a paying audience). But toward the end of the nineteenth century, instances arise in which the meaning of "spectacular failure" is closer to "remarkable and widely witnessed debacle." After that transition is well underway, the earliest instances of "fail spectacularly" begin to appear.