Never perhaps did any man suffer death with more justice, or deserve it less.
I don't think that Hamilton intended any ambiguity here, but I think I see how the ambiguity might arise for a modern reader.
I believe that the meaning of suffer here is the first sense in the OED, namely:
I. To undergo, endure.
- trans. To have (something painful, distressing, or injurious) inflicted or imposed upon one; to submit to with pain, distress, or grief.
a. pain, death, punishment, †judgement; hardship, disaster; grief, †sorrow, care.
To suffer death was a common and very old phrase in legal contexts. Melville riffed on it in a chapter in his novel White-Jacket.
I believe that in the phrase with more justice, the word justice takes sense 1.2 in ODO (no link, sorry, because I apparently am not allowed to link more than twice per post), namely,
The administration of the law or authority in maintaining just behavior or treatment.
I don't think Hamilton intended the phrase suffer death with more justice to be ambiguous, or that it would have occurred to him that it could mean that André suffered "death like a brave man," but I think I see how a modern reader, not familiar with the phrase suffer death, might be confused.
The trouble is that although, grammatically speaking, the verb suffer in Hamilton's sentence is in the active voice, taking death as its object, the meaning of the word suffer is passive. The word passive, in fact, comes from the Latin word for "suffer" (OED). Hamilton wouldn't therefore have imagined that a reader might think that it was André who was displaying "more justice," because in Hamilton's mind, the action in the sentence was being performed not by André but by the authorities who were executing him. It was their action that was being performed with "more justice," that is, with greater adherence to the proper administration of the law.
Although it's plausible grammatically, I don't think it's quite viable to construe the sentence as meaning that André underwent his execution more appropriately, or with more fairness and reasonableness. Under such a construction, André would be showing appropriateness, fairness, or reasonableness toward death, and I'm not sure what it would mean to be fair or reasonable toward death, unless death is being personified, which it doesn't seem to be here.
As for the pronoun it, I think it is ambiguous, grammatically speaking, but doesn't impair Hamilton's meaning. It, as deployed in this sentence, can refer either to death or justice, but in André's case, death was justice; that is, death was the punishment that a due administration of the law demanded in a case of spying. So in Hamilton's mind, there's no possible misunderstanding for the reader to trip over.