I’d say no. If anything, it’d be dishonorable, but it’s Law and not Good (or, at least, Lawful Good) that concerns itself with codes of honor, but considering they were pirates who presumably had every intent to kill you, using lethal force is perfectly reasonable. Good characters are not expected to take prisoners rather than kill, unless the person in question is an innocent, perhaps having been misled or mind-controlled, or perhaps in the case of surrender.
In this case, they fell to an offensive action, and were slain. Considering the potency of sleep, this would most likely be a tried-and-true combat method in any setting that followed the rules of Pathfinder. Not killing them/taking them hostage might be a Good act, and killing them is certainly not, but that doesn’t necessarily push it all the way to Evil.
Moreover, to address the concerns in your question, a single Evil act does not an Evil character make.