The bolded part is wrong and it's a propaganda that u have been fed to believe.
Pakistan don't have an ideology and from the very beginning of its creation its trying to find one to keep itself united.
Yes, having a common religion is working as a factor to give the people of whole Pakistan a sense of unity (who r from diverse culture and ethnic background), its not enough.
Hence, the only way Pakistan can unite its people is by constantly going on a war. Fighting solders instil a sense of patriotism amongst civilians. It also allows its army to spend a God portion of its gdp behind its military at the cost of living being of its citizen.
Bangladesh don't have such problems. As a matter of fact, from the very beginning of our independence Ind haven't done anything that can actually considered as a threat to the sovereignty of BD.