Refer to this post about why Pak's economy is in dire condition.
PTI government axes hundreds of superfluous projects including a major CPEC power project
As for Bangladesh having more reserves and better performing economy...there are two reasons.
1) Their government has been doing a good job on having its focus on improving the economy.
2) They have long been putting their defense needs on the back burner.
In case 1, Pak has had a terrible leadership for decades.
In case 2, Pak can't afford to neglect its defense spending bcuz of constant threat of India. This requires Pak to spend billions.
Additionally WoT took quite a toll. Pak had to spend a lot of money on that too. It also deteriorated the security situation internally as the mess in Afghanistan spilled over into Pak. This caused additional expenditures and decline in investments.