No, it was not an evil act
Was it a Good act? Probably not. But there's that N in the middle for the act to fall under. On the one hand, the pirates were helpless, and thus not an immediate threat. However, on the other hand, they were enemy combatants brought down by a legitimate weapon of war. If you weren't in the lawless wilds, a case might be made for sparing their lives - however, you were in fact in the lawless wilds. A ship has limited provisions, even more limited space, and shoddy security with which to hold active and hostile forces your prisoner. Delivering them to civilization would only have resulted in their deaths anyway (typically by hanging, the traditional penalty for piracy), so with keeping them being impractical and freeing them being immoral, the only other option is to kill them.
Now, if you're going to execute them anyway, a Coup de Grace is frankly the ideal tool. Waiting for them to be conscious and having them duel you is both arrogant and immoral, as you're arming a dangerous enemy around innocents. A Coup de Grace while they're unconscious is swift, merciful, and preserves their dignity as sapient beings by not forcing them to suffer undue pain and humiliation. Afterwards, a sea burial with a minimum of fuss or insults would be appropriate.
Is it dishonorable? Probably. But Chaotic Good is still good, and Chaotic Good would be pointing out the above.
Heroes of Horror, Champions of Valor and Champions of Ruin are great resources for understanding 3.PF's alignment system; though they don't actually solve the problems of alignment arguments, they do go to great lengths discussing gray areas, the conflict between good intentions and evil actions (and vice-versa) and what it means to be good and evil. You'll still have to do quite a bit of work and extrapolation yourself, as they don't actually cause alignment to make sense (nor do they explain or overwrite previous inconsistencies and double standards, of which there are many) but they're a great guide for thinking about alignment and thus making judgements about aligned actions.
In chat, BESW added these statements from the alignment section of the PFSRD:
First: Good characters and creatures protect innocent life. Evil characters and creatures debase or destroy innocent life. Emphasis on "innocent" both times, which pirates are not.
Second: Good implies [...] a concern for the dignity of sentient beings. Your point about mercy killing hinges on giving them a dignified death.
(Quote edited: bolding added for ease of reading)
The PFSRD then goes on to state that Evil beings kill out of convenience; however, killing these pirates is not simply a matter of convenience. Not only are they likely to die anyway (as the result of their conviction for various crimes), but most ships, as stated before, lack reliable resources for holding people prisoner - especially for holding them prisoner in a fashion consistent with compassion and human(oid) dignity. A swift death while the Sleep spell has them unconscious preserves their dignity, avoids unnecessary pain, and prevents further harm and threat to innocent seafarers who might otherwise have been victimized by these pirates.