One reason is may be difficult to stop Somali pirates is simply due to the huge size of the Indian Ocean. International forces patrolling the Indian Ocean in the northern part and in the Gulf of Aden need to cover one and a half million square miles, which is almost the same size as two-thirds of the land mass of the United States. Also, the Somalian coastline is about the same size as the coastline of the eastern United States.
Another possible reason is that with NATO forces, for example, they do not arrest and prosecute the pirates. They take away their weapons and ladders and leave them enough fuel to return to Somalia.