Upon the gallows hung a wretch — Imp

A rack with boon was fallen by a naughty boy (wretch) who hung on the rack (gallows). Boon is "the stalk of flax or hemp after the fibre has been removed" (OED n.2).

Upon the gallows hung a wretch,1
Too sullied for the hell
To which the law entitled him.
As nature's curtain fell
The one who bore him tottered in ,-5
For this was woman's son.
"'Twas all I had," she stricken gasped-
Oh, what a livid boon!
(F.1775/J.1757)
[1] gallows:: a rack to lay the boon in line eight. wretch:: a naughty boy, an imp.
[3] the law entitled him:: for the wretch was still a child.
[4] nature's curtain:: a rack with boons looked like a curtain.
[7] 'Twas:: indicating the gallows, not her son the wretch. It's printed as 'Twas in the Complete Poems (1924) and Franklin's version.
[8] boon:: the central stem of the flax without the flaxy exterior.

The watering of the flax is that process in which the stalks are steeped or exposed to moisture for a longer or shorter period. The object of this process is that of inducing the separation of the flaxy material, by exciting a slight degree of fermentation in the substance which attaches it to the stem of the plant. This flaxy exterior is called the harl, while the central stem or woody portion is termed the boon or reed, and it will at once be understood that the harl is that portion which yields the flaxen fibres. ─ The Saturday Magazine (1842)