They're pirating because it's profitable and there's a low risk of getting into real trouble, like dying or suffering. Everything else in the current magnitude of pirating is just an excuse. Failing, or getting caught, usually means that they're stripped of their weapons and equipment, but then let free to try again. Western states aren't interested in hauling them back to home with them, since for the pirates the western jails are no worse than what they face at home and on top of that they might be eligible for asylum afterwards. Just don't get caught by the russians or chinese.
Piracy is business. The groups sent to sea are funded by investors or some wealthy pirate staying ashore. You can get new pirate sailors for cheap while the equipment costs the most, although the weapons are cheap. If they fail the investor at most loses the equipment. The risk is neglible compared to the profits - try again and you may well gain back what you lost and even get profit.
Piracy is made possible by the anarchist state of the country. There's no central government, not the kind that has any power whatsoever. There's no navy and there are innumerous safe havens on land. The armed groups are more powerful than any government force, which is forced to stay on defensive. The rebels have nothing but to gain from piracy that can be used to fund their cause. So there's not only those seeking for wealth but also rebels seeking for more power. And money is power.
Better yet, they're raiding ships that are nowhere near the Somalian waters. Try to make up an excuse for that; other than that the somalian waters have more patrols.
The foreign fishers pretty much abandoned the place once it became too dangerous to operate. The "somalian coastguard" ran out of fishing ships and turned their attention to other ships, realising how good business it was to capture fishing ships for ransom. That's where their justification ended.
They're not on a just cause by any means, only greed. Just like many others around the world touting for a just cause.