Was he simply defeated? Was a matter of 'bad luck'? Odds were always really limited?
This isn't really a history question, but more speculative. Given that, I can speculate.
Manpower
This is the most commonly-mentioned factor in the second Punic War. Hannibal proved more than up to the task of defeating Roman armies in pitched battle, but the Romans had vastly superior manpower reserves and could afford to suffer catastrophic losses and still keep pressing. Not only were there many Roman citizens by this time, in the City itself and the Campanian heartland, but also citizens scattered all over Italy in Roman colonies. Besides these, the Romans could (in most cases) count on their Latin and Italian allies. The historian Livy explains this in his history (XXIX.3.12). The Roman historian Brunt estimated that during the second Punic war, there were over 200,000 men under arms. I myself think this number is a little inflated, but we do know that the Romans resorted to various measures to boost their manpower: after the disaster at Cannae, they enrolled criminals and slaves into the army and makeshift navy; those too young to serve were enrolled anyway; maritime colonies not usually obligated to provide troops were compelled to do so; et cetera. On the other hand, the Carthaginians had a difficult time "motivating" their own citizens to fight and were very reliant on mercenaries.
Finances
War is an expensive business. Carthage had been an economic powerhouse in the Mediterranean before the First Punic war, but the resolution of that conflict weighed heavily on the city. The Treaty of Lutatius stripped Carthage of Sicily and all the revenue associated with it. In addition, Carthage had to pay heavy ransoms for the return of important POWs and pay a war indemnity to the Romans on top of it all. This was 2,200 talents of silver (66 tonnes!) and more besides. The result was that the city was immediately ruined financially and was unable to pay her mercenaries. They revolted, causing the "Mercenary War," during which Rome stole away Sardinia and Corsica. Carthage tried to restore her economy with new territory in the Iberian peninsula, but those ambitions ultimately just sent them back into conflict with the Romans.
By the beginning of the Second Punic War, the Carthaginian financial situation had recovered somewhat (they were able to recruit further mercenary forces, at least), but Punic North Africa and a contested, proto-urbanized Iberia could not match the raw economic output of Italy. Under the Romans, North Africa would become one of the richest, most productive areas in the ancient world, but this process was still in its infancy in the late 3rd century BCE. The sheer number of human beings in Italy, and with them the sheer amount of production capability, probably would have smothered the weakened Carthaginian economy no matter what the outcome of Hannibal's invasion (barring the capturing of Rome itself).
I should note that Rome, too, felt the cash crunch of the war, especially with Hannibal disrupting the prosperity of Italy. The Roman fiscal system got an overhaul in 212, almost certainly due to the burdens of the war. Livy (XXVI.35.5) mentions heavy and frequent impositions of tributum, and in 215 the Scipio boys were trying to squeeze money out of the Iberian locals. Nevertheless, the Roman coffers were suffering less than the Carthiginian.
Allies
In many ways Rome was extremely fortunate to possess so many allies in Italy, and even more fortunate that most of those allies remained loyal. Most of the defections were in the South and among the Samnites, but in the heartlands most cities remained staunchly Roman (Capua being an obvious exception). None of the Roman colonies and none of the Latin colonies went over. These cities represented important sources of manpower and money. Those cities that did defect to Hannibal offered him little help in his war -- most were busy preventing their recapture by the Romans, or else were mostly interested in their own independence via Hannibal's army and not in helping a foreigner to rampage in Italy. Early on in the invasion, Hannibal had "liberated" the Celts of the Po Valley and they were glad for it. Some probably even enrolled in Hannibal's army. The population at large, however, made no real attempts to help further and did not harass Rome. They didn't even assault Placentia and Cremona, two large Roman-controlled colonies in their midst.
Hannibal's own behavior did him no favors when it came to acquiring useful allies in Italy. When he faced opposition from Italian enclaves who wanted to remain loyal to Rome, he was ruthless. He killed indiscriminately in Umbria and Picenum, and destroyed the important and ancient city of Nuceria in Campania. These acts and other similar incidents may have angered Italian cities that were "on the fence" so to speak. On the other hand, the Romans too were ruthless with those that proved disloyal. Capua decided to go with Hannibal and payed a heavy price for that decision. I suspect that in the end, most of the Italians feared the Romans more than they feared Hannibal, even when the Romans were being whipped up and down the peninsula. They had been brutalized for centuries and perhaps had become convinced that opposition to Rome was ultimately a hopeless endeavor.