The two earliest occurrences of the phrase to appear in a Google Books search, are from the 1740s, and both f them refer explicitly to "throwing away good money after bad." From Colley Cibber, An Apology for the Life of Colley Cibber (1740):
Upon a Run of good Audiences, he [a stage "Menager"] was more frighted to be thought a Gainer, which might make him accountable to others, than he was dejected with bad Houses, which a worst, he knew would make others accountable to him : And as, upon a moderate Computation, it cannot be suppos'd, that the contested Accounts of a twenty Years Wear, an Tear, in a Play-house, could be fairly adjusted by a Master in Chancery, under four-score Years more, it will be no Surprize, that by the Neglect, or rather the Discretion of other Proprietors, in not throwing away good Money after bad, this Hero of a Menager, who alone supported the War, should in time so fortify himself by Delay, and so tire his Enemies, that he became sole Monarch of his Theatrical Empire, and left the quiet Possession of it, to his Successors.
And from Publicus, "A Letter from a Freeholder to a Member of Parliament," in The Gentleman's Magazine (1748):
Amongst the great number of persons that have, by several acts, been discharged, I never could recover any part of the debt they ow'd me, nor have I ever heard of any other person that has received any part of his debt ; but, on the contrary, the debtors have either spent, or collusively and fraudulently convey'd away their estates and effects ; so that the creditors have been left without redress or satisfaction, to repent their throwing away good money after bad, and been forced patiently to suffer the insults of the debtors after discharged.
The notion here explicitly involves discarding "good money" (money still in one's possession, and therefore still capable of being put to worthwhile use) after having, in effect, discarded money that is now "bad" (no longer in one's possession, and therefore—if nothing of value came of it—wasted).
As FumbleFingers notes in a comment added to Josh61's answer, the first instance in Google Books search results of the more common modern wording "throw[ing] good money after bad" occurs in The London Chronicle for the Year 1763 (1763) [snippet window does not show the cited wording]:
He does not care to throw good money after bad, as the saying is ...
Update (June 12, 2019)
I just came across a somewhat earlier instance of the expression than Colley Cibber's from 1740. It appears in John Stevens, A New Dictionary, Spanish and English, and English and Spanish (1726) in an entry explaining the meaning of the Spanish phrase "echar un viróte tras ótro":
Echar un viróte tras ótro, to send one shaft [that is, arrow] after another. When one servant is sent to fetch another, and both stay ; Or when a man throws away good money after bad.
Stevens presents the phrase as if it were as familiar to him as the colloquial "send one shaft after another" (which he also uses), suggesting that the expression may have been well established in at least one part of England by 1726.
Also fairly early is this excerpt from a letter from Mr. Partridge to Mr. Popple, dated November 10, 1736, in Calendar of State Papers Colonial Series, America and West Indies, 1735–1736 (1913):
Thou wilt see it is a claim for a loss and damage sustain'd allmost 4 years since by the subjects of the French king at Martinico for wch. to this day we have never been able to gett the least satisfaction ; we trusting in ye justice of the French Court and rightiousness of our cause well hoped for success but in ye end to our mortification found ourselves miserably deceiveed and that we only threw away good money after bad etc.
Both of these instances use "throw away good money after bad" in a very modern-sounding way, it seems to me.