It's written that Caesar said he'd kill the pirates in jest, but he was a man of his word, so...
It's possible Caesar considered himself their guest (as insane as that sounds, considering he was kidnapped) and expected to be treated as such (very well, especially given his station). Going from the retribution (execution), while insane by modern standards, would be somewhat more normal for the time (hospitality was a big deal in the Classical World), if still harsh.
Ransoming nobles was a very different thing in ancient times. So long as you treated your captive decently and ransomed them for an acceptable price, you would not only receive your ransom, you would be considered generous and merciful for doing so (rather than executing them). Failure to treat a captive noble well would probably result in war if the grieved party was capable of it.
Piracy was seen as a major problem in the Mediterranean at the time, and for a "foreigner" to kidnap a Roman nobleman was considered a major crime against Rome in and of itself, and crimes against Rome (or perceived crimes against Rome, or imagined crimes for that matter) never went without disproportionate retribution. Let's face it, whole wars have, throughout time, started for the most petty reasons, because not everyone saw war as something to avoid.