The clue to understanding this poem is in its name: a satirical elegy. Swift, renowned as a master of satire, uses his cutting wit in this poem to issue a warning to statesmen and others who, like the Duke in the poem, make themselves so unpopular in life that they "made [people] weep before they died," and thus will garner no mourners at their funerals.
The first stanza of the poem is a pastiche of a more standard elegy or eulogy, declaring disbelief at the Duke's death and sadness that such a great warrior should have gone out "so inglorious, after all." However, Swift quickly follows up on this with the comment that when the noise of the "final trump . . . grows stronger / He'd wish to sleep a little longer," suggesting that when the Duke becomes aware that he is about to meet his God, he will have no desire to do so, fearing the outcome.
Evidently, Swift has no love for this Duke, who "this world . . . cumbered long enough." He also states that this was a commonly held opinion of the Duke, who received no "widow's sighs, nor orphan's tears"—he had caused these people such grief in life that they were delighted he was dead. And so, Swift says, other nobles, only "bubbles raised by breath of kings," should be "taught by this rebuke / How very mean a thing's a Duke." A duke, if he should live his life badly, Swift says, will die ignominiously and without his "ill-got honours" as he returns, like all of us, to dirt.