The simple reason is that this isn't a computer game. The logistics of reaching Baghdad are not simple, and then there's the issue of the morale of his army, not to mention leaving the empire undefended in the process. His losses due to disease alone would have been staggering. On the other hand, if he'd lived longer, it could have been possible. To really strike into Mesopotamia you need to control Eastern Anatolia/Kurdistan to use as a base. That's certainly not beyond his reach.
An army is an army, though. Cities taken by force get sacked. Still, more would have survived than did at the hands of the Mongols, so it would have been a much better result.
Well, it seems pretty much certain that John could have sacked Bagdhaad if he had tried-by this point the Abassid caliphate was virtually impotent (this was made obvious during the Seljuk invasion).
But like Abdul Hadi Pasha says, it would have been a major risk. Baghdad was 650 kilometers away from the nearest Byzantine territory. What if the expansionist Fatimids (perhaps responding to an Abassid plea for help) had decided to launch an invasion of Syria? Without any significant forces to stop them, they may very well have jeopardized Nicephoras Phocas' conquests in the region. Now what? John is forced to race back home, having at best wasted his time (the emergency would cost him any potential loot or prestige amassed from the capture of Baghdad)
Anyway, the Basileus (according to Norwich) was due to meet the Pope at Antioch, so he was pressed for time. And given the absymal Byzantine-papal relations at the time, skipping the meeting would have been unwise, to say the least.
My question is, why did John effectively deny himself such a glorious opportunity by inconveniently agreeing to a meeting with the bishop of Rome? Pity.