Over the Cold War, the Soviets usually propped up nationalist secular regimes in the Middle East while the US/UK propped up Sunni fundamentalists. For instance, Pakistan’s turn to Islamism was fueled by the US propping up Zia-ul-Haq, who was a military dictator who “Islamified” much of Pakistani law by introducing the Hudood Ordinances (effectively Sharia law) and a series of blasphemy laws – not to mention supporting the forbearers of the Taliban. He was a key ally in the proxy war against the Soviets in Afghanistan, which is why the US propped him up. Of course you also have the Gulf countries (Saudi Arabia, UAE, etc.) who are in practice Islamofascists but have grown to be the wealthiest Muslim nations with lavish Western support.
So the fall of the Soviet Union and subsequent regimes aligned to it left a huge ideological vacuum in most Middle Eastern countries that’s been mostly filled by Sunni fundamentalism – being the “winner’s” ideology from the Cold War and nationalism/ secularism having suffered a crushing defeat.
Bangladesh is actually quite secular as a whole, with the ruling party steering the country towards that direction, and even has several Communist representatives in their parliament. But as a relatively poor Muslim-majority country they’re susceptible to being instrumentalized by global terror networks. The 2016 Dhaka attack was carried out largely by foreign terrorists, ISIL claimed a lot of attacks over the past few years and the country’s most prominent Islamic terrorist organization are known to be funded by Pakistani and Gulf Arab contributors – which underscores the problem of Islamofascists having so much goddamned money and influence, and the farce of Western nations simultaneously being squeamish over Sunni extremism and not only having created the problem, but to this day continuing to prop it up.