The phrase "coming out" has a fairly rich history of figurative usage stretching back to at least 1637. My answer focuses on three senses of term, in order from oldest to youngest: "making an appearance," "entering society," and "publicly avowing one's homosexuality."
'Coming out' as 'making an appearance'
J.S. Farmer & W.E. Henley, Slang & Its Analogues (1891) has this first definition of "come out":
COME OUT, verbal phr (common).—1. To make an appearance; to display oneself; to express oneself vigorously; to make an impression (especially in sense 2 ["To turn out; to result"]) Sometimes in an intensified form TO COME OUT STRONG.
Farmer & Henley then lists two examples, both involving the form "coming out," although the authors warn that "The first quot. is doubtful, but it looks like an anticipation." Here are the fuller versions of those two citations. From Samuel Rutherford, letter to "my Lady Boyd" (May 1, 1637), in Joshua Redivivus, or Mr Rutherford's Letters (1765):
Madam, our debts of obligation to Christ are not small; the freedom of grace and salvation is the wonder of man and angels: but mercy in our Lord scorneth hire; ye are bound to lift Christ on high, who hath given you eyes to discern the devil, now coming out in his whites, and the idolatry and apostasy of the time well washen with fair pretences; but the skin is black, and the water foul: It were art I confess, to wash a black devil and make him white.
And from William Thackeray, The Newcomes: Memoirs of a Most Respectable Family (1855):
Then Clive told us of his deeds during the winter; of the good fun he had had at Rome, and the jolly fellows he had met there. Was he going to astonish the world by some grand pictures? He was not. The more he worked, the more discontented he was with his performances somehow: but J. J. was coming out very strong, J. J. was going to be a stunner.
'Coming out' as 'entering society'
The earliest dictionary notice of "coming out" in the sense of "entering society" that I have found is in John Bartlett, Dictionary of Americanisms, fourth edition (1877), where it appears as the third definition in the entry for "To come out." All three definitions are worth repeating here, however:
To come out. 1. An expression used among certain religious enthusiasts, meaning to make an open profession of religion. [Example:] I experienced religion at one of brother Armstrong's protracted meetin's. Them special efforts is great things,—ever since I come out, I've felt like a new critter. Widow Bedott Papers [1856], p. 108.
2. "How did you come out?" means, how did you fare in your undertaking? Come off would be more agreeable to English usage. To come out at the little end of the horn means to fare badly, to fail. [Example omitted.]
3. A young lady when she first makes her appearance in society is said to come out. [Example:] Clara, just seventeen, and a very pretty girl, is looking forward with impatience to next year, and coming out in society. — Miss Gould, Marjorie's Quest, p. 46.
Bartlett only slightly alters the quotation from Jeanie Gould, Marjorie's Quest (Boston, 1872). Here is the original example:
There were seven of them [children of Mrs. Maxwell]: Percy, two years older than Regie, a Freshman at Yale and very superb accordingly (that is, at home; when at college he endured a sufficiency of snubbing from those intolerable Sophs); then Clara, just seventeen, looking forward with impatience to next year, and "coming out" in society.
This definition of "to come out" is new to the fourth edition of Bartlett; the third edition (1860) lists only the first two definitions.
A Google Books search turns up an even earlier instance of "coming out" in the social sense of the phrase in a novel published in London in 1835—with the difference that the person coming out is male. From James Payn, From Exile (1835):
Mr. Bree always behaved himself; he did not suck his knife, or prefer the use of the back of his hand to that of a table napkin; he did not grunt defiance, nor laugh when he shouldn't in a coarse, demonstrative manner, or stand with his hat on very much on one side (as some people did) in the presence of the ladies of the house. On the contrary, he was very polite; indeed, so studiously so that one would almost think he had refreshed himself after his legal studies, before coming out into society, by the perusal of some work on etiquette.
And soon after Payn, another book published in London took up the female side of coming out. From Eliza Farrar, The Young Lady's Friend; A Manual of Practical Advice and Instruction to Young Females on Their Entering upon the Duties of Life, After Quitting School (1837)
I asked a gentleman once, if he did not think Miss C––––– very pretty and ladylike;—"I used to think so," was his reply, "but I saw her treat an old gentleman rudely, and she has never looked pretty to me since." I often think of this, when I see young girls just coming out into society pushing themselves before their elders, elbowing their way to the supper-table before wives and matrons, accepting the attentions of elderly gentlemen as if they were conferring, instead of receiving favours, and treating those whose age and station entitle them to marked respect from young people, with as much careless familiarity as they would their own classmates.
Mrs. Lincoln Phelps, Hours with My Pupils: Or, Educational Addresses, Etc. (New York, 1859) devotes considerable space in "Address II: Dignity of Character" (originally delivered in 1842) to the subject of coming out:
False notions of life often fill the minds of young girls about to leave school. The expressions "coming out into society," "finished education," "entering life," etc., seem to mean something, though what this something is, cannot a;ways be easily defined.
The "coming out" of a young lady, or her being permitted to partake freely of fashionable dissipation, is but a poor beginning for a life of duty, trials and cares. It would be far better if, for the foolish notions which too often fill the heads of young girls, could be substituted more just and rational ideas of life. ... The idea that in "coming out," a young lady must have admirers, and that the greater their numbers the greater her triumph, naturally leads her into folly and flirtations. In her haste to secure beaux she perhaps loses a worthy and devoted admirer, who becoming disgusted with her frivolity and apparent heartlessness, leaves her for one less brilliant, but more worthy of his affection.
But as interesting as the debutante meaning of "coming out" is, use of the term to describe a religious enthusiast's open profession of faith is even more striking (to me) as an antecedent for the much later gay sense of "coming out." That sense of the phrase appears as early as the second edition of Bartlett (1859), with further details in the associated entry for come-outers, which first appeared in the first edition of Bartlett (1848):
COME-OUTERS. This name has been applied to a considerable number of persons in various parts of the Northern States, principally in New England, who have recently come out of the various religious denominations with which they have been connected; hence the name. They have not themselves assumed any distinctive organization. They have no creed, believing that every one should be left free to hold such opinions on religious subjects as he pleases, without being held accountable for the same to any human authority. ... —Evans's History of Religions, with Additions by an American Editor
The religious sense of "coming out" is absent from Farmer & Henley, however, so it may have dropped out of use (and memory) by the end of the nineteenth century.
'Coming out' as 'publicly avowing one's homosexuality'
J.E. Lighter, Random House Historical Dictionary of American Slang (1994) has this entry for "come out":
come out v. Homosex. to openly acknowledge one's homosexuality, esp. by beginning to engage in homosexual acts. ... [First three cited examples:] 1941 G. Legman, in G. Henry Sex Variants II 1161: Come out To become progressively more and more exclusively homosexual with experience. 1949 Gay Girl's Guide 5: Come Out: To be initiated into the mysteries of homosexuality. 1963 Stearn Grapevine 5: The phrase "coming out" ironically indicated a lesbian's sexual debut: being "brought out" reflected the same result.
The earliest instance that a Google Books search finds of "coming out" used in connection with an open profession of one's homosexuality is in Erving Goffman, "The Moral Career of the Mental Patient" (1958), reprinted in Goffman's Asylums: Essays on the Social Situation of Mental Patients and Other Inmates (1961). Goffman begins by describing the acclimation of recently arrived patients to life at a mental hospital:
Usually the patient comes to give up this taxing effort at anonymity, at not-hereness, and begins to present himself for conventional social interaction to the hospital community. ... Sometimes this making of oneself available is called "settling down" by the attendants. It marks a new stand openly taken and supported by the patient, and resembles the "coming-out" process that occurs in other groupings. 28
Then, in the accompanying footnote 28, Goffman describes one of the "other groupings" he has in mind:
28 A comparable coming out occurs in the homosexual world, when a person finally comes frankly to present himself to a "gay" gathering not as a tourist but as someone who is "available." See Evelyn Hooker, "A Preliminary Analysis of Group Behavior of Homosexuals," Journal of Psychology, XLII (1956), pp. 217–25; see especially p. 221. A good fictionalized treatment may be found in James Baldwin's Giovanni's Room (New York: Dial, 1956), pp. 41-57. ...
Conclusions
"Coming out" has been used figuratively to mean "making an appearance or displaying oneself" for centuries. The example from 1637, cited in Farmer & Henley, Slang & Its Analogues, seems legitimate to me, though the authors of that dictionary say rather that "it looks like an anticipation."
"Coming out" in the sense of "entering society" goes back to 1835 (with reference to a young man in England), to 1837 (with reference to young women in England), and to 1842 (with reference to young women in the United States) in Google Books searches. A now-obsolete use of the phrase—at least in the infinitive form "come out," to mean "make an open profession of religion"—was current by 1848, according to the first edition of Bartlett, Dictionary of Americanisms.
And finally, "coming out" in the sense of "presenting oneself openly (at least in some settings) as homosexual" is documented as far back as 1941 (in Lighter, Random House Historical Dictionary of American Slang) and 1958 (in Google Books search results).
As to the specific question, "Was the 'the debut in society' the origin of its usage [with reference to homosexuality]?" you could certainly make a strong argument that the two are directly connected. But other possibilities exist as well, and at least one other use of "coming out" was gaining steam during the 1930s—the decade prior to the first citation in Lighter: "coming out of [one's] shell."
A Google Books search for "coming out of his shell" finds one match from 1903 (from Bernard Shaw's Man and Superman), another from 1930 (from Gordon Stowell, The History of Button Hill), another from 1931 (from L'École Canadienne, Revue Pedagogique), and another from 1933 (from Richard Hatch, Leave the Salt Earth)—all in the sense of "emerging from self-imposed (and perhaps self-protective) isolation."
One phrase that seems to have emerged too late to take credit as the source of "coming out" is the longer wording "coming out of the closet." The first Google Books match for this phrase is from Douglas Stange, Metanoia, volumes 2–8 (1970[?]):
We are, some of us, coming out of the closet, or at least turning on the lights. We are finding out who one another are, and affirming each other in living a Christian lifestyle that is also gay. And, shoulder to shoulder with our non-gay Lutheran brothers and sisters, we are extending to our church, as individuals and through our thirteen chapters across the country, a ministry of education and understanding.
J.E. Lighter gives a first citation for "come out of the closet" of 1971, and a first citation for "in the closet" and "closet queen"—both from Mart Crowley's play, The Boys in the Band—of 1967.
Historically "coming out" has been used idiomatically to refer to a number of ideas associated with taking one's place openly and visibly in the world. It may be that multiple senses of the phrase influenced the emergence of the phrase in a specifically gay milieu. But because homosexuality was such a taboo in the United States and other English-speaking countries, particular terms may have evolved underground (as it were) over an unknown number of years, and that evolution in the shadows may make tracing the origins of gay terminology unusually difficult.
Best Answer
tldr; - See: SO WHERE DID COPYPASTA COME FROM
Josh wrote a very interesting question about the origins of the term copypasta. I find it very intriguing as well. He did some excellent homework on the origins (see above in his original question posting).
It appears the word may have originated after being coined in use by 4chan's Anon community circa 2006.
I say may have because I'm still not convinced that it actually originated there; it may have but that's not entirely clear yet. However, let's just assume that's right. I would like to dive into how it may have come into existence (even if it did originate there - this is more about the "why" and "how").
Without even checking the link above it is obvious that copypasta is a portmanteau of "copy" and "pasta". However, why did users begin to coin this phrase? RaceYouAnytime makes a great answer post about some findings on the use of the word; but I find the answer to Josh's post less about the nature of whether it's derogatory or not and rather more about why and how it came into use.
PASTA HISTORY
First, some history. What does "pasta" have to do with anything? Well, back in the early days of computer programming many languages shared a feature known as a "goto" statement (which also required a label - you would "jump" to the label by saying "goto begin-loop", or some such thing. This created a mess of coding, especially if the coding was unplanned or ill implemented. By the mid 1980's or so we had a full fledged pejorative for this type of thing: Spaghetti Code. It's mentioned as early as 1977 at a symposium, but it was not until around 1979 that we had a published version of the word. However, references to "Spaghetti" type coding go all the way back to 1968 (or at the least the beginnings of problems with "goto" type programming).
COPY/PASTE HISTORY
Fast forward a few years, maybe even up to a decade or so, and we also have the rise of "copy/pasting". Technically it goes back to as early as 1975-1980 but it was not pervasive until the 1980's, even the later 80's.
THE INTERNET AND SPAM
By the mid 1990's the inernet and "web browsers" were catching on very quickly, email use began to proliferate, and SPAM had begun to be a serious issue. It gained a definite pejorative sense extremely quickly. I mention spam here not only because of it's reference in the OP's post but because the internet and tech culture has a long and storied history of using food and various other items to describe derisive and unwanted terms and/or to create portmanteaus.
SO WHERE DID COPYPASTA COME FROM, OR RATHER, WHY DID WE BEGIN USING IT?
I believe it began as a way to combine the pejorative's of "spaghetti code" (noodles or pasta) with the unwanted and intentional copying/pasting (or SPAM-like activity) into a portmanteau that embodies both concepts. It's a word the community came up with to describe a way of "noodling" or "jumbling" the content of sites by casually copy/pasting information all over the place.
The internet, and the rise of forums, social networks, memes (more about that in a moment), etc... gave way to a culture in which we create new words all the time. It makes sense too. In the last 40 years we have seen more innovation than the entirety of human history (which goes back, arguably, from 300k-500k years for "modern" homosapiens). We need these words. But internet subcultures, which up until roughly 10 years ago (best case), were composed of people who by their nature were curious, innovative, and looking for more compact ways to express ideas. This has always been the aim of the programming elite and various techy subcultures.
It's in this way that I think the word came to be. This was likely the communities way of saying, "stop copying/pasting things all over because its noodling up our site and adding no value [as it can be found elsewhere with a simple link]". I would imagine this was the case because it's likely that a subset of programmers or techies started the use of the word, especially as far back as 2004-2006, and I would imagine they were combining the concepts of spaghetti code (or pasta) and the idea of SPAMMING (which was being done by blatantly copy/pasting everywhere) to create the portmanteau: copypasta.
I think the mixing of the words, copy and pasta, into a portmanteau is very similar and analogous to how the phrase, spaghetti code, came into existence. It seems highly likely with the early internet culture's obsession with Monty Python skits, which were, at least partly, the fuel for the usage of food items (such as SPAM) to describe undesirable actions, that this is how we came upon, "copypasta". This would be my overall hypothesis.
EXAMPLES OF INTERNET OR TECH ORIENTED ITEMS RELATED TO FOOD
I'm not going to include an exhaustive list but there are some I can think of right away. I'll include items from this discussion as well for completeness:
Again, there are others, this is just what I thought of right now.
And this last one I have set aside for special consideration:
This is not conclusive at all (fair disclaimer) but it is another hypothesis of mine that the many, many decades long use of the word hash, hash tables, hashing, hash trees, hash graphs, hash functions, hash maps, hash keys, etc... could have ultimately come from the food item "Hash" (a meat dish chopped up in bits in various configurations depending on locale).
In fact the interesting thing is that if you look at a hash mark (the common "pound" sign - another indication it may have roots in food), #, it resembles, potentially, a dish that has been cut up into pieces for serving. This is just something I find very interesting but I would need to do more research to give it a fair level of confidence.
And it's not just foods either. I could fill pages with the various acronyms, portmanteaus, compound type word structures or phrasings, etc... that have been created in various tech subcultures throughout the decades. One's which either have a certain assonance, onomatopoeia, or metaphorical ring/tone. It's literally endless as far as that goes. Interesting stuff :)
MEMES
I said I would mention meme's and I want to just briefly mention it because it's amazing to me how this word became so popularly used today. It doesn't necessarily relate exactly to the question but it's tangentially important to understanding this overall concept. Meme was a scientific word. It was a word that anthropologists and social biologists used to describe social viral concepts. "Meme", as it is used today is another example of how the true meaning of a word can change, how internet culture can affect its purpose, and even radically change the intention.
Meme as used today, by most younger people, just means a picture/GIF with some very catchy, funny, phrasing on it - usually one that has had viral success. That is how that word mutated to what it is today. As opposed to it's original intent which was rooted in anthropological and biological studies to understand how ideas/concepts are shared among a culture, and passed from generation to generation, like a "virus". I think it's an important and great example of how we see words come into being, change meaning, or, at least change meaning within certain contexts (the meaning has not totally been lost in this case). I would like younger readers to understand that "meme", and how it relates to "viral", are so very close in meaning and relation to each other but they did not actually describe the same process originally. The concept of something "going viral" is almost directly borrowed from "meme". But a "meme" to most young people is a thing that has become viral (not the mechanism by which social viruses are transmitted - which is closer to it's original scientific purpose). I guess we could say that the GIF (or now even YouTube videos) is the memetic mechanism for information exchange and viral phenomenon. But most young people don't understand that interpretation. It's a brave new world :) We live in a constantly evolving soup of words and euphemisms :)