J.E. Lighter, Random House Historical Dictionary of American Slang (1997) gives first citations of 1939 for "legal eagle" and 1949 for "legal beagle." Both terms have the same definition:
an attorney, esp. one who is notably skillful or zealous. Usu[ally] joc[ular].
Lighter doesn't suggest that legal beagle arose in response to legal eagle, as an even more jocular term, but I think that it probably did. Harold Wentworth & Stuart Flexner, Dictionary of American Slang, first edition (1960), attaches slightly different meanings to the two terms:
legal beagle n. A lawyer, esp. an aggressive or astute one.
legal eagle n. An extremely capable devoted, or cunning lawyer.
Wentworth & Flexner puts both terms in the "Intentional and jive rhyming terms" subcategory of "Rhyming Terms and Rhyming Slang"—and this certainly seems reasonable. But the dictionary doesn't take a position on whether "legal beagle" grew out of "legal eagle."
Google's Ngram chart for "legal beagle" (blue line) versus "legal eagle" (red line) for the period 1920–2005 looks like this:
Early instances of 'legal eagle'
One striking early instance of "legal eagle" appears in a review of an American musical play called Wildflower, in the Sydney [New South Wales] Morning Herald (December 1, 1924):
A newcomer, Charles Zoll, appeared as Gaston La Roche, a bumptious upstart in a loud check suit, a "legal eagle" with a gun in his hand, whose ingenious plans to irritate Nina were foiled by his own jealous quarrels with Lucrezia.
Newspapers across Australia echoed the term "legal eagle" in connection with this musical for the next three years. There is evidently a slightly older reference to Wildflower and the character Gaston La Roche, "the legal eagle," in the Altoona [Pennsylvania] Tribune (October 27, 1923), but I don't have a subscription to Newspapers.com, where the instance is to be found.
Further research discloses that Otto Harbach and Oscar Hammerstein II wrote the lyrics for Wildflower, which opened in New York City on February 7, 1923; the name of the "legal eagle" in some productions appears as "Gaston Larotta" instead of "Gaston La Roche." The relevant lyrics occur in the "Act One Finale" of the musical:
LAROTTA: [spoken to BIANCA and ALBERTO] Don't worry. She has got to live with my wife for six months with-out losing her temper. It can't be done!
BIANCA AND ALBERTO: [sung] We'd better trust the legal eagle.
LAROTTA: I'm the lawyer to engage.
BIANCA AND ALBERTO: He will chase her like a beagle.
LAROTTA: I'll surprise her in a rage.
BIANCA AND ALBERTO: Yes it's sure as can be / That he will shortly earn his fee. / For a legal beagle, legal eagle is he.
From an untitled item in Traction Shop and Roadway, volume 2 (1929) [combined snippets]:
Now Electric Traction Hole-In-One Club, has a "legal eagle" A. L. Vencill, of the legal department of the Union Switch and Signal Company, negotiated a hole in one shot at the Edge- wood Country Club, Pittsburgh, Pa., on June 19, 1928.
From "Yarns," in the [Sydney, New South Wales] Catholic Press (October 20, 1932):
The Legal Eagle.
"How did you get on in your action for compensation against the man whose dog bit you?"
"He had a clever lawyer who proved that I bit the dog."
From "This Time It's the Circus for the Three Marx Bros." in Life magazine (December 4, 1939):
Walking on the ceiling by means of suction cups on her shoes is the circus specialty of Peerless Pauline, the upside-down woman (Eve Arden) in At the Circus. Her other specialty is concealing the $10,000 which a gang of crooks has stolen from the circus owner. Groucho, as J. Cheever Loophole, "the legal eagle," comes to recover the money.
And from "With the Alumni," in Princeton Alumni Weekly (October 14, 1940):
Tom Leidy was appointed a solicitor for Federal Deposit Insurance Corp. in Reading, Pa., where he is an attorney-at-law; Dwight Parsons, legal eagle of Akron, Ohio, attended the Republican National Convention in Philadelphia; ...
The term "legal eagle" also appears in the December 2, 1940, and May 20, 1941, issues of Princeton Alumni Weekly. A bookstore advertisement in Michigan Raw Review (1941) [combined snippets] offers this enticement:
For it is said in the First Volume of Blackstone: To Be a Legal Eagle Get Your Wings at Wahr's Bookstores 316 South State Street
From a two-line item in Fortnightly Telephone Engineer, volumes 3–4 (1942):
Leighton H. Peebles calls attorney Graham Morrison his "Legal Eagle".
From an unidentified article in Time magazine, volume 39 (1942) [combined snippets]:
Where Does the SEC Stand? In its eighth year, under its sixth chairman, Ganson Ourcell (TIME, Jan. 26), SEC is not the thrill-a-minute New Deal star wagon it once was. For one thing, defense and war have drawn heavily upon its brilliant staff. OPA took not only ex-Commissioner Leon Henderson, but Utilities Expert Joe Weiner, Legal Eagle Dave Ginsburg; many a lesser technician has gone to defense work. Betting is that only 750 of its 1,250 employes will follow SEC to Rittenhouse Square.
From "Notes on Sports: Crime and Punishment," in The New Yorker (1943) [combined snippets]:
Lloyd Paul Stryker, the legal eagle, landed himself a client last week who not only had already confessed and pleaded guilty but had been convicted and sentenced. As a matter of fact, upon thinking it over, Mr. Stryker apparently decided that the case, while offering a splendid challenge, had its drawbacks, and he withdrew from it.
From "Ellery Queen: Crime Made Him Famous and His Authors Rich," in Life magazine (November 22, 1943):
Since this episode [involving a doctor who pointed out numerous errors in Queen's descriptions of medical practice in a mystery novel], Dannay and Lee have made a practice of checking medical details in advance of publication with their family physician. They also retain a lawyer to set them straight on matters of law; they once had their legal eagle struggling uninterruptedly for two days and two nights trying to fight his way out of a problem involving a complicated will.
The Daily Racing Form Monthly Chart Book, volume 48, issue 10 (1943) lists a racehorse named Legal Eagle.
And from an item in The American Oxonian, volumes 30–31 (1944) [combined snippets]:
Houston continues as legal eagle with Sullivan and Cromwell, and rising exponent of "the last result of human wisdom acting upon human experience for the benefit of the public" (Samuel Johnson).
"Nothing of interest to report." From which we may gather that Bill is still Lynchburg's legal eagle and that he still has one wife and two children.
A very early instance of "legal eagle" in the United States appears Henry Gaston, The Little Lawyer; or The Farmers'. Mechanics', Miners', Laborer's, and Business Men's Adviser and Legal Help and Legal Adviser (1880):
A legal silver dollar weighs 412½ grains, troy.
A legal eagle weighs 258 grains, troy.
A double-eagle weighs 51b grains, troy.
The standard of gold and silver is nine hundred parts of pure metal and one hundred parts of alloy in one thousand parts of coin.
As the quotation suggests, an eagle was a $10 gold piece and a double-eagle was a $20 gold piece. The modifier "legal" before each name simply indicates that government specifications required the weight of each coin to meet the specification in order to be legal tender. So the "legal eagle" here is not a lawyer or even a human being.
Early instances of 'legal beagle'
I ran a series of searches for "legal beagle" and could not find a match older than the semi-nonsensical one cited in the posted question from "Imptorials," in Implement & Tractor Trade Journal (December 24, 1921):
FAME ENOUGH WAS CONFERRED UPON HIM AT HIS CHRISTENING.
For our part we are quite willing to pass the immortelles to Outerbridge Horsey, Banker Stillman's legal beagle.
However, Google Books yields several matches that are older than the second Wiktionary match, which is from 1947. The oldest of these matches is the one from Wildflower, noted earlier, although there is some doubt as to whether the lyric containing "legal beagle" was in the original version of the musical.
The next-earliest match that I found for "legal beagle" comes from an unidentified article in Publication of the American Dialect Society (1944), commenting on the phrase [combined snippets]:
At least for the world within the prison, then, we believe we can assume three reasons for synonyms: first, a basic human delight in word play that creates such rhyming slang as legal eagle or legal beagle; second, the large inventory of names which already exist in American speech, from which Negro names, for example, come; and, finally, those which arise from the particular problems of everyday life in prison.
Two others come from 1946. First, from an advertisement for The Case of the Half-Wakened Wife, a mystery novel by Erle Stanley Gardner in Life magazine (among other publications) (January 21, 1946):
A scream! A splash! A shot! Then the fateful cry, "Man Overbo-o-oard!" And the next thing you know, you find yourself clutching a beautiful woman wearing only a thin nightgown. In her hand she holds a gun—from which one shot has just been fired!
That's the predicament in which PERRY MASON suddenly finds himself. But that's onlt the beginning! Events rush madly by. Now the lady stands before the court. Accused of murder. And guess who her lawyer is. Perry Mason, of course—the "legal beagle" with a list of acquittals as long as the D. A.'s face. Mason is the only person in the world who believes his client to be innocent. So what does the lady do? She FIRES him!
And second, "Class Notes," in Princeton Alumni Weekly (September 27, 1946):
That glare on Wall Street probably comes from a large brass plaque engraved E. Newton Cutler, assistant vice-president of National City Bank, and around the corner the law firm of Davis, Polk, Wardwell, Sunderland & Kiendl (advt.) now challenges any other firm to equal its four-man '37 representation, namely, Charlie Pierce, Lang Van Norden, your secretary, and, as of July 1, none other than that noted corporation legal beagle Jack Irwin.
The term "legal beagle" also appears in the November 1, 1946, issue of Princeton Alumni Weekly, while "legal eagle" appears twice in the same general period—in the February 14, 1947, issue and the May 16, 1947, issue.
The more intriguing instance of "legal beagle," however, is the one involving Perry Mason, the mystery-solving defense attorney of Gardner's many novels. The man and the phrase make a repeat appearance in the Life magazine issue of January 19, 1948, this time in an advertisement for in another Gardner novel, The Case of the Crooked Candle:
A figure lies on a blood-stained carpet aboard a boat aground in the bay. The tide goes out. The boat keels over. Suddenly the body begins to roll ... over and over, faster and faster ... until it slams to rest against the starboard cabin wall!
Nimbly the "corpse" jumps to his feet—with a big grin on his face! It's Perry Mason—and the tireless "legal beagle" has just solved one of the weirdest cases of his career. A case that rests on the curious clue of a wax candle which is so important that it sends a man—and very nearly the WRONG MAN—to the electric chair for murder!
Both of these early allusions to Perry Mason as a "legal beagle" seem to be a play on his astonishing ability to uncover the truth in a tangled mystery—an ability that makes him seem part lawyer and part bloodhound. But why "legal beagle" instead of "legal bloodhound"? Aside from the appeal of the rhyme, I think, the ad copywriter was probably influenced by the existence of "legal eagle," which seems to have been in increasingly common use as a U.S. slang term since the late 1930s.
The foregoing examples indicate that "legal eagle" was ubiquitous in U.S. slang at a time (1944) when "legal beagle" was just getting out of the gate—at least as a popular expression. But both "legal eagle" and "legal beagle" appear in at least some versions of the lyrics of Wildflower, a musical that enjoyed considerable success in the United States and abroad following its debut in 1923. In Wildflower, the character Gaston La Roche (or Larotta) presents himself as both a brilliant lawyer (a "legal eagle") and a clever sleuth (a "legal beagle").
In Australia, where productions of Wildflower traveled the country for years, "legal eagle" seems to have caught on in the 1920s directly from the play's popularity. In the United States, there are few matches for "legal eagle" between 1923 and 1939, when the Marx Brothers movie At the Circus appears, with Groucho playing a "legal eagle" lawyer. Still, by the mid-1940s, "legal eagle" seems to have become a fairly well-established expression in the United States.
As for "legal beagle," Australians show no sign of having taken to it as an alternative to "legal eagle" or as an expression in its own right. In the United States, "legal beagle" shows signs of catching on around 1946, suggesting that it may have emerged as a jocular variation on "legal eagle" after that term had become firmly established in U.S. slang. Use of the term in advertisements for Perry Mason crime novels may have helped it become more popular.
Still, Harbach & Hammerstein's Wildflower appears to have used both "legal eagle" and "legal beagle" in its lyrics in 1923 and (in my view) deserves credit as a foundational source of both terms.
I conclude with brief responses to the three questions asked up top:
1. Is the beagle variant a play on words, a mondegreen or an eggcorn?
Both "legal eagle" and "legal beagle" appear to be products of what Wentworth & Flexner, Dictionary of American Slang (1960) calls "intentional and jive rhyming."
2. What are the connotations of these terms? Can they be used negatively or are they usually positive?
The terms connote very similar things: lawyerly skill, doggedness/devotion, and cunning. Because both terms are normally used with a jocular edge, they can be interpreted in a negative light in the right context, where the usage suggests derision because the "legal eagle/beagle" had just committed a blunder. But they are also sometimes unmistakably used to express admiration.
3. Did another famous detective beagle, or hound, inspire the coinage of legal beagle?
In the 1920s, the character Gaston La Roche (or Larotta) in the musical play Wildflower gained renown as "the legal eagle"—and in one set of lyrics also as "a legal beagle"—albeit in a musical play in which his lawyerly cleverness comes to nought. In 1939, Groucho Marx's pettifogging lawyer, J. Cheever Loophole, in At the Circus may have helped resuscitate "legal eagle" in U.S. slang. And in the 1940s, Earle Stanley Gardner's mystery-solving lawyer, Perry Mason, seems to have been associated, at least temporarily, with the term "legal beagle." Whether these three famous fictional legal eagle/beagles are responsible for the emergence and popularization of "legal eagle" and "legal beagle" in U.S. slang is unclear, but I think that all three may have played a significant role.