Historically piracy is the direct result of poor working conditions, dire poverty, and systematic economic exploitation of the lower classes. As the following quote makes clear:
In an honest Service, there is thin Commons, low Wages, and hard Labour; in this, Plenty and Satiety, Pleasure and Ease, Liberty and Power; and who would not balance Creditor on this Side, when all the Hazard that is run for it, at worst, is only a sower Look or two at choaking. No, a merry Life and a short one shall be my Motto
—Pirate Captain Bartholomew Roberts
This does not mean Pirates are nice simple folk. Indeed, they are usually a rough and criminal type. But what gives them the final push into piracy is the economic despair they find themselves in. Take that away and you take away the root cause of piracy. Try simply to fight them or execute them and you just create heroes and martyrs to inspire more pirates.
Check out the following clip from Democracy Now after doing so, I highly recommend reading Two Piracies in Somalia
What is very clear from this interview and this essay is, just as in past centuries, Piracy is the direct result of economic exploitation and dire poverty. By all means arrest and punish pirates for their crimes. I think, however, the crimes that lead to piracy must also be stamped out if we are actually to end it.