The story
From goody (“goodwife, obsolete title of respect for a woman”) + two + shoes. Generally considered to have originated with the title character in The History of Little Goody Two-Shoes (1765), which indeed seems to be the source of its later use as a common noun with the present meaning. However, as a proper noun with implications of wealth rather than goodness, it is also found earlier, c. 1687, in the writings of Charles Cotton: “Why, what then; Goody Two-Shoes, what if it be? / Hold you, if you can, your tittle-tattle, quoth he.”
Etymology from Wiktionary, CC BY-SA 4.0.