Amalfi's explanation is the easiest. Look at a map of Amalfi and the Sorrento peninsula sometime. It's an extremely odd place for a maritime power - it doesn't really have a sheltered natural harbor, and it's squeezed between the mountainous spine of the peninsula and the sea. It rose to importance as a trading city because a) what else are you going to do on the side of a rocky prominence in the sea where you can't grow much of anything, and b) that same rugged terrain gave it some protection from landward attack. It never had the obvious gifts of Genoa or Venice, however, and lacked the rich hinterland of Pisa; correspondingly, its growth and power were capped, and it was doomed to be overtaken by its competitors. It lasted only as long as it took for those competitors to catch up, and then it was destroyed and slumped into relative obscurity.
The reasons for Gaeta's decline are less obvious, as Gaeta was at least marginally more privileged geographically than Amalfi, but Gaeta followed a similar trajectory of flourishing and then being eclipsed fairly early on by the northern maritime powers. Gaeta may have suffered from both an internal schism between territorial and mercantile "factions" and its proximity to Latium, which meant it was drawn into the politics of 10th/11th century Rome and all that entailed. Gaeta is a particularly interesting case as it seems to have had a "consular" government with some similarities to northern city-states by the late 11th century, quite a bit earlier than most cities in the north developed such institutions, but that "experiment" was eventually quashed by the centralizing of the Norman kings.
As for Naples, the city never became much of a trade or maritime power in the Middle Ages despite its excellent harbor. Crucially, the leadership of Naples prior to the Norman conquest was territorial in nature; far from having a "poor hinterland," the elites of early Naples had prosperous estates and drew their power and wealth from land exploitation rather than maritime trade. Unlike Amalfi, where the sea was the only resource of note, Naples could do just fine with its possessions much closer to home. Correspondingly, it tended to look inward, and was involved in local Lombard-Byzantine power struggles (although even little Amalfi was hardly immune to this; for a while the dukes of Amalfi conquered and ruled Salerno as well). Naples was a busy port and produced goods, but it never took much of an interest in carrying those goods, a status which did not change appreciably after the Norman conquest.
I don't really like the North-vs-South comparison in general; the two countries had very different geographical, political, and historical contexts. Arguably it was northern Italy which was the abnormality in a European sense: the relevant question is not so much why the southern cities "faltered" compared to the North, but why the North came to be so different from the rest of Christendom, and there's already been tanker truckloads of ink spilled on that.