Is it from someone flying two flags (standards are a type of banners or flag) and say riding both sides of the fence? I'm guessing here as I can find nothing on this. but it sounds logical to me.
'Double standard' as two equivalent standards
The earliest matches for "double standard" in a Google Books search across the years 1800–1900 relate to currencies based on both gold and silver. For example, The Opinions of Sir Robert Peel, Expressed in Parliament and in Public, Second Edition (1850) includes these consecutive excerpts on the topic of "A Joint Gold and Silver Standard":
The notion of a double standard is totally fallacious, and would be found impracticable in effect ; nor has it ever been for a moment entertained by Mr. Locke, or any others who have advocated a silver standard.—Mr. M. Attwood's Motion on the Currency, June 8, 1830.
Now, if we proceed to alter the currency, the first question would be, shall we have a double standard of gold and silver conjointly, or shall we simply alter our standard from gold to silver? I cannot see any advantage derivable from the institution of a double standard. You cannot make a double standard without first defining the ratio which is to exist between the nominal value of the two metals. To say that every man should pay his debts in silver or gold, whichever he may please, without defining the relative value, would be absurd and impracticable. ... —Mr. Cayley's Motion for the Adoption of a Silver Standard, June 1, 1835.
Mentions of a "double standard" in connection with bimetallism occur as early as March 19, 1821, and continue until as late as 1900, the last year of the search period I used. The term also comes up in connection with corn gauged by weight and measure (1834), with sugar gauged by grain and whiteness (1834), with duty to "the Charter and the King" (1843), with obedience to "the Book of Scripture ... and the Book of Nature" (1848), with Iceland's old double monetary valuation standard of wadmal (wool) and silver (1874), and with milk gauged by solids and fat (1896).
The essential feature of bimetallism is that it attempts to establish a constant ratio of equivalence between gold and silver, so that both metals have a consistent relative value and are, in that sense, interchangeable—just as, in the United States today, four metal quarters and a paper one-dollar bill are interchangeable (or exchangeable). So the double standard doesn't imply that one standard unfairly benefits the metal to which it applies at the expense of the metal subject to the other standard, but that the two standards are in balance and are fair to both metals.
One of the more interesting abstract uses of the term double standard arises in "Origin, Nature and History of Oaths," a review of James Tyler, Oaths, Their Origin, Nature and History, in The Law Magazine (November 1834):
The chief objection, however, to the use of oaths is, that it establishes a double standard of veracity : it recognizes the principle that it is possible by some human contrivance to increase the obligation to tell the truth ; a principle in our opinion utterly false, and fraught with the most pernicious consequences. A person who deliberately made a statement in a court of justice knowing it to be false, would, in our opinion, commit the same moral offence, whether he had forsworn himself or not : we can discern no difference between the guilt of the liar and the perjurer.
Here again, the point is not that the two standards put witnesses to very different levels of obligation (although that is clearly the implicit logic of the pro-oath movement), but that morally they are equivalent and entail the same level of obligation and, therefore, that the second standard—requiring witnesses to swear an oath—is unnecessary.
Not terribly surprisingly, the entry for double-standard in Charles Morris, The American Dictionary and Cyclopedia, Volume 4 (1900) refers exclusively to bimetallism:
double-standard. In economics the phrase Double Standard is used to signify a "Double Standard of Monetary Value." It implies the existence of what is known as the Gold Standard on the one hand, and the Silver Standard on the other. Wherever the Double Standard in its integrity is in use, a creditor is bound to accept payment of any sum in coins of either of the metals, gold or silver, which the debtor may choose to tender.
'Double standard' as separate and unequal standards
One of the earliest instances of double standard in the sense of separate and unequal systems of appraising human conduct turned up in a Google Books search appears in Frances Harper, "A Double Standard" (1895), a poem that focuses on the severe imbalance in the standards by which society judges a woman and a man involved in a love affair. The poem concludes with this quatrain:
No golden weights can turn the scale
Of justice in His sight;
And what is wrong in woman’s life
In man’s cannot be right.
Another early instance of double standard in connection with separate and unequal standards for men and women appears in Newton Riddell, A Child of Light: Or, Heredity and Prenatal Culture Considered in the Light of the New Psychology (1900), who devotes an entire chapter to "Heredity and the Double Standard":
Nature and law are always consistent. Whatever is inconsistent is abnormal. The social ethics which fosters in man what it condemns in woman is wholly inconsistent and therefore abnormal. The conditions which give rise to the double standard are as truly the product of dissipation as are those that produce drunkenness, vice and crime. The double standard is most demoralizing. As a factor in obstructing human progress, in perverting man's nobler instincts, in destroying domestic happiness, in filling the world with misery and in robbing offspring of good inheritance, it has no equal.
Riddell goes on to explain that the fundamental element of the "double standard" he has in mind involves social attitudes toward chastity.
The Wikipedia article quoted in Josh61's answer cites an even earlier instance of the use of double standard with regard to morality. From a review of Josephine Butler, "The Unjust Judgments Prevalent in Society, on Subjects of Morality," in The Ecclesiastical Observer (May 1, 1872):
The Christian religion sets up an equal standard of morality for both sexes ; it proclaims an absolute rule of personal purity on all alike, and as if to correct, with scourging, the falsehood of the existing double standard, Christ threw the whole weight of His authority into His rebukes of male profligacy, while with infinite tenderness, He restored the slave of man's lust to her place among the free.
Perhaps the most striking aspect of double standard as used by Butler, Harper, and Riddell is that the doubleness that the term refers to is grossly and brazenly unequal, whereas proponents of previous varieties of double standards sought emphasize the equivalence of the alternative measures offered as dual standards.
Butler, Harper, and Riddell notwithstanding, double standard in the sense of applying unequal criteria to assess the same behavior or work didn't appear in a Merriam-Webster Collegiate Dictionary until the Seventh Edition (1963):
double standard n 1 : BIMETALLISM 2 : a set of principles that applies differently and usu. more rigorously to one group of people or circumstances than to another
The term standard, as you mention, originates from 'military banner' which later evolved to mean weight, measure: (from Etymonline)
- "weight, measure, or instrument by which the accuracy of others is determined," late 14c., from standard (n.1) "military standard, banner," a particular use in English of this word, but the sense evolution is "somewhat obscure" [OED]. The standard weights and measures were set by royal ordinance and were known as the king's standard, so perhaps metaphoric, the royal standard coming to stand for royal authority in matters like setting weights and measures. Hence the meaning "authoritative or recognized exemplar of quality or correctness" (late 15c.). Meaning "rule, principal or means of judgment" is from 1560s. That of "definite level of attainment" is attested from 1711 (as in standard of living, 1903.
the expression double standard appears to have its origin in the concept of moral standard ('expected' behaviour) around 1870, (from Wikipedia):
is the application of different sets of principles for similar situations. A double standard may take the form of an instance in which certain concepts (often, for example, a word, phrase, social norm, or rule) are perceived as acceptable to be applied by one group of people, but are considered unacceptable—taboo—when applied by another group.
The concept of a double standard has long been applied (as early as 1872) to the fact that different moral structures are often applied to men and women in society.
"Unjust Judgments on Subjects of Morality". The Ecclesiastical Observer (London: Arthur Hall and Co.) XXV: 167–170. April 1, 1872.
Josephine E. Butler (Nov 27, 1886). "The Double Standard of Morality". Friends' Intelligencer and Journal (Philadelphia: Friends' Intelligencer Association). XLIII (48): 757–758.