We've been through this before. First, the "tens of billions of dollars" diverted to military infrastructure is a ridiculous exaggeration. Whatever the true number is, it's high but it's not freaking $10b. Of this I am very confident, because I know people who traveled to Gaza to do humanitarian aid and their trips were funded by a Gaza ministry. I suppose it's theoretically possible for me to know all three people who received such grants from Gaza, but I think it's highly, highly unlikely.
Second, the blockade was not triggered by terrorism. Israel threatened to blockade if Hamas won the election, and when Hamas did, Israel blockaded. It was in response to an election, not terrorism.
As for this humanitarian aid, how exactly should Gaza spend this money if it is blockaded? People can't be expected to invest in businesses if they can't get water and power reliably. Nobody is going to invest to build factories in Gaza if the infrastructure could be turned off at the whim of the Israeli government. From a political angle, the blockade has meant that Palestinians blame Israel for their material deprivations, and thus they don't blame Hamas for grifting or skimming. By all measures, the blockade has been self-destructive in addition to being cruel and inhumane.
The present conflict owes more to that blockade than any other factor. This isn't really an open question, in my mind. It's like the Treaty of Versailles. Collective punishment doesn't work and it's wrong.