Emergence of the punitive sense of 'sanction' in dictionary definitions
Samuel Johnson's Dictionary of the English Language (1756) has this entry for sanction:
SANCTION. s. {sanction, French ; sanctio, Latin.} 1. The act of confirmation which gives to any thing its obligatory power ; ratification. 2. A law ; a decree ratified.
The first of these definitions expresses the "approval" notion that remains one important meaning of sanction. The second is clearly ancestral to sanction in the sense of "punitive law," but here it seems to apply with equal readiness to laws that are positive, negative, or neutral toward people or nations they address. I note, too, that Johnson defines sanction exclusively as a noun; there is no entry for the word as a verb.
Noah Webster, A Compendious Dictionary of the English Language (1806) assigns much the same meanings to the word, although even more briefly:
Sanction, n. a ratification, confirmation, decree
Sanction, v. t. to ratify, confirm, support
Interestingly, the first big Webster's Dictionary, An American Dictionary of the English Language (1828) condemns the "law or decree" sense of sanction altogether:
SANCTION, n. {Fr[ench] from L[atin] sanctio, from sanctus, holy, solemn established.} 1. Ratification ; an official act of a superior by which he ratifies and gives validity to the act of some other person or body. A treaty is not valid without the sanction of the president and senate. 2. Authority ; confirmation derived from testimony, character, influence or custom. [Example omitted.] 3. A law or decree. {Improper.}
SANCTION, v. t. To ratify ; to confirm ; to give validity or authority to.
Webster doesn't explain why the meaning that he had included in his dictionary 22 years earlier—and that Johnson had included in his dictionary 50 years before that—was "Improper"—but presumably it had to do with the fact that a "law or decree" might not entail ratification as Webster understood the term, and so it was a loose usage.
The 1828 definitions remained unchanged in the revised editions of Webster's dictionary for 1840 and 1847, but a major change occurred in the American Dictionary of the English Language of 1864:
Sanction, n. (Lat[in] sanctio, from sancire, sanctum, to render sacred or inviolable, to fix unalterably ; Fr[ench] sanction, Sp[anish] sancion, It[alian] sanzione} 1. Solemn or ceremonious ratification ; an official act of a superior by which he ratifies and gives validity to the act of some other person or body ; establishment of any thing as valid, or giving authority to it ; confirmation ; approbation and acceptance ; support. [Example omitted.] 2. Any thing done or said to enforce the will, law, or authority of another ; as legal sanctions.
In effect, after 36 years of disgrace as an "improper" meaning, the "law or decree" definition of sanction reemerged (with Merriam-Webster's approval) as a new "thing done to enforce the will, law, or authority" definition. The phrase used to illustrate the new meaning is striking because it's the one we use today in connection with the punitive sense of sanction: "legal sanctions."
Early instances of 'legal sanction[s]' and 'sanction[s] against'
The phrase "legal sanctions" has been in use for centuries, as a Google Books search for "legal sanction" and "legal sanctions" confirms. The earliest match for either term that a search turns up is from Jeremy Taylor, Ductor Dubitantium: Or, The Rule of Conscience in All Her General Measures, second edition (1671):
This also appears in that we find the original of the Quadragesimal or Lent-fast attributed to other causes and beginnings then the tradition or Canon Apostolical. Cassian says, that as long as the perfection of the Primitive Church did remain, there was no observation of a Lent fast ; for they who spent the whole year in abstinence were not tied with the necessity of a precept or legal sanction.
And the next is from Peter Walsh, The History & Vindication of the Loyal Formulary or Irish Remonstrance (1723, reprinted from 1673–1674):
For certainly nothing can be more obvious to reason, than that since our own, either formal or virtual, express or tacit owning of so many uncatholick Positions, and so many unchristian practices (by our own continual refusing to disown them, or either of them, in any sufficient manner, or as we ought by any proper Test) hath been of our side hitherto the only immediate cause of all our woes, and especially of all those legal Sanctions, which upon due reflection do without doubt render our best condition even at present anxious : ...
Both of these instances, it seems to me, may be taken to involve sanctions in the sense of decrees or rulings or authorizations. But the phrase "sanction [or sanctions] against" (which produces even earlier matches in a Google Books search) carries a necessarily negative sense that easily accommodates a notion of punitive action. From a 1638 translation of Gerard Langraine, A Review of the Councill of Trent:
Wee may take notice by the way, of the prohibition made by the Councell, and the Pragmatique sanction against the Popes, that they should not take any thing for the mantle or Pall, which they were wont to sell to Archbishops and Metropolitans, at a good round price ; ...
And from William Sanderson, A Compleat History of the Lives and Reigns of Mary Queen of Scotland, and Her Son and Successor, James the Sixth, King of Scotland (1656):
In the Kings return out of Scotland, the people took occasion to complain in common, and to petition in particular, That the freedom of Servants and Laborers, was extremely enslaved by their Masters pretended zeal and sanction against Idolizing (as was pretended) of such days as ancient custome from General Councils, and the Church of England reformed, even to that time, had appointed to be kept Holy.
It thus appears that sanction in the sense of formal approval and sanction in the sense of hostile decree have coexisted in English for more than 300 years.
Follow-up (August 26, 2021)
I ran searches in Early English Books Online for "legal sanction[s]" and "sanction[s] against" and was rewarded with a number of additional early matches for these terms.
The earliest of the 13 unique matches for "legal sanction" is the one from Ductor Dubitantium (1660), cited above; but additional instances occur in a February 15, 1676, speech by the Duke of Buckingham in the house of Lords, in a 1679 discourse on Christian loyalty by William Falkner, and a 1680 book on monuments of antiquity by William Atwood, and nine later works. In most of these instances, "legal sanction" clearly means "legal approval," but in the following instance, from Walter Cross, An Exposition of the Second Verse of the Fourth Chapter of the Epistle to the Romans (1694), the sense of the term seems somewhat different:
In that it [the law uniting Man and God] has no Legal Sanction, no Threatnings, there was no need of any; since he was so sufficient and faithful, nor no possibility, for the greatest Penalty was the Duty of the Precept.
Here, it seems to me, the notion of "legal sanction" in play is at least "legal enforcement" and very possibly "legal penalty."
Another interesting instance occurs in John Templar, A Treatise Relating to the Worship of God (1694):
By Sin we brought our selves into a state of bondage, under an obligation to undergo the penalty of the Law. The sentence of condemnation was denounced against us, and we juridically bound to suffer. In order to the redeeming of us from this condition, Jesus Christ has been pleased to lay down a sufficient price in our stead agreeable to the expectation of the Law. This is stiled〈words in non-Latin alphabet〉, which includes both a commutation and a compensation. It was laid down in the place of that which was due from us. Our Blessed Lord redeemed us from the Curse of the Law by being made a curse. He suffered that which was a valuable consideration, and did answer all the ends of the legal Sanction.
Here, "legal sanction" seems to amount to "judicial decree" (which happened to be a death sentence).
An EEBO search for "legal sanctions" turns up five matches form publications dating from 1673–1674 to 1696, the first of these is the one by Walsh, cited above, which seems to me to hint, at least, at legal encumbrances, disadvantages, or strictures being applied against Catholics.
An instance in Thomas Long, A Vindication of the Primitive Christians in Point of Obedience to Their Prince Against the Calumnies of a Book Intituled, The Life of Julian, Written by Ecebolius the Sophist as also the Doctrine of Passive Obedience Cleared in Defence of Dr. Hicks (1683) is even less ambiguously punitive:
I beg my Readers pardon that I may animadvert a little on these Libellers, and acquaint them, that to their Progenitors we owed the kindling, fomenting, and inflaming those late Wars, that made us a confusion at home, a scorn and a reproach abroad. Prynne, Burton, and Bastwick, were like so many Foxes let loose and encouraged, like the Priests and Preco's of Mars, to scatter Fire-brands through the Nation. Nor would the times permit a little water to be sprinkled for the quenching of them, but fed them with oyl. The Laws were silenced and out-lawed then, as they are now, as if indeed we were inter Arma: there wanted not scourges to punish them, but an arm to inflict the legal Sanctions.
Other instances, however, seem to use "legal sanctions" in the sense of "legal enactments" or perhaps "legal vindications," and don't seem to carry an element of punishment as a major theme.
EEBO searches for "sanction[s] against" find 15 unique matches, including the two cited above. The earliest of these is 53 years older than the one in A Review of the Councell of Trent. From Thomas Bilson, The True Difference Betweene Christian Subiection and Unchristian Rebellion (1585):
This wisedom and freedom the Clergie men of Fraunce and students of Paris shewed and vsed in maintaining the Pragmaticall sanction against diuerse Popes from the yeare of our Lord 1438. till the yeare 1516. which Leo the 10. (that in our dayes wrested it out of their handes) is forced to confesse.
Here the clergy and student are presented as taking advantage of a "Pragmaticall constitution made by the authoritie of the Councell of Basill" as a legal shield against attempts by a series of Popes to renege on obligations agreed upon at that Council. The "sanction" (or law) itself was not punitive; it was simply adverse to the interests of the Popes. "Pragmatic sanction" had a particular meaning in French law, according to Black's Law Dictionary, fourth edition (1957):
PRAGMATIC SANCTION. In French law. A solemn ordinance or decree of a sovereign dealing with matters of primal importance and regarded as constituting a part of the fundamental law of the land. It originated n the Byzantine Empire; in later European history it was especially used to designate an ordinance of Charles VI, emperor of Germany, issued April 1713, to settle the succession on his daughter, Maria Theresa. It was ratified by the Great Powers. On the death of the emperor, it was repudiated by Prussia, France and others, which led to the War of the Austrian Succession.Int. Encycl.
In the civil law. The answer given by the emperor on questions of law, when consulted by a corporation or the citizens of a province or of a municipality. Lec.El.Dr.Tom. § 53.
But as the EEBO sources show, notions of "pragmatical sanction" are far older than the War of Australian Succession. In any event, "pragmatical sanction" seems to differ fundamentally from "penal sanction."
An explicit reference to "penal sanctions" appears in George Mackenzie, Observations on the Acts of Parliament, made by King James the First, King James the Second, King James the Third, King James the Fourth, King James the Fifth, Queen Mary, King James the Sixth, King Charles the First, King Charles the Second (1686):
This [law criminalizing "all Writing, Preaching, and Prayers, and such malicious Expressions, to stir up the people to a dislike of His Majesties Royal Prerogative and Supremacy in Causes Ecclesiastick"] is the first Act whereby Conventicles are Discharg'd,* and in it they are call'd, Nurseries of Sedition; But yet there is no penal Sanction against them in this Act; but by the 2 Act of the 3 Sess. of this Parliament, they are Declar'd to be fineable in a fourth part of the yearly Rent, every Burgess being to lose the priviledge of his Burges-ship, and Merchandizing, beside the payment of a fourth part of his Moveables.