Bangladesh separated from Pakistan in 1971, rejecting Pakistani nationalism. Love for Bengali language and Bengali ethnicity were powerful motivators. Many Bengalis of erstwhile East Pakistan felt that Pakistani religious nationalism was a trap that claimed West Pakistanis and Bengalis were brothers but refused to give them equal status and share in power. Religious parties' near unanimous opposition to Bangladesh's independence movement and the support they provided to Pakistan army during the liberation war increased Bangladeshi misgivings to religion's role in politics. Hence, Bangladesh came into being as a secular republic.
The first constitution of Bangladesh proclaimed secularism as one of the four basic principles of the new republic (other three being Bangladeshi nationalism, socialism and democracy). The new republic also avoided putting a crescent and a star on its flag, revealing the minor role Islam played in Bengali nationalism. Even the green color on the flag is not linked to Islam (as it is in many Muslim-majority nations' flags, like Pakistani, Moroccan, Saudi Arabian flags etc.). Green color symbolizes the the lush green land of Bangladesh. Furthermore, Bangladesh's national anthem, Amar Sonar Bangla (My Golden Bengal). is also a tribute to Bengal and has anti-religion connotations. It was written by Rabindranath Tagore in 1905 against Partition of Bengal on religious lines in 1905. Add to it many speeches/statements of Bangladesh's founder Sheikh Mujib-ur-Rehman and it is beyond doubt that Bangladesh's nationalism was ethno-linguistic and secular.
Despite all these evidences of secular nationalism, Bangladesh quickly reversed its course and dropped secularism. In 1977, fifth constitutional amendment introduced by military ruler Zia-ur-Rehman removed secularism as one of the basic principles and replaced it with the following words "Absolute trust and faith in the Almighty Allah shall be the basis of all actions". In 1988, another military ruler Hussain Muhammad Ershad made Islam the state religion of Bangladesh. For the next fifteen year, religious parties role and overall religious discourse increased and it appeared Bangladesh is still part of Pakistan, with military and religious parties controlling politics and manipulating religious discourse. Awami league, the founding party of Bangladesh, despite its strong attachment to the principle of secularism, also had to accept the reality of the situation as any support for secularism was portrayed as pro-Indian and anti-Islam by its rival, Bangladesh Nationalist Party (BNP).
While secularism seemed defeated and religious nationalism on the rise, there was one problem; religious nationalism had difficulty legitimizing Bangladesh's separation from Pakistan. It was only on the basis of ethno-linguistic nationalism that a separate country Bangladesh can be explained to the new generation. New generations were thus socialized in a much different environment (more secular) than those ruling elite that grew up in Pakistan.
Things began to change with the arrival of the twenty-first century. It appears a new generation socialized in the secular nationalism of Bangladesh came of age and started occupying positions of power. Their sentiments was cashed by Awami League, the party of the Sheikh Mujib-ur-Rehman, now led by his daughter, Sheikh Hasina Wajid. Courts, media and intellectuals also helped and promoted the secularism/restoration of 1972 constitution movement. In 2005, high court declared fifth constitutional amendment illegal and secularism was reintroduced as one of the basic principles of the republic. Sheikh Hasina then decided to take on religious parties. She established tribunals to punish those who were involved in crimes against Bangladeshis during the war of liberation. It was a politically astute move as it not only mobilized her own voters and many others but also damaged Jamaat-e-Islami (a religious party whose leadership supported Pakistan Army in 1971 and now usually supported her rival BNP). Although, there was outcry against the partiality of these tribunals, a large majority of Bangladeshis supported these trials and punishments awarded by these tribunals. The trails revived the dubious role played by many religious leaders, implicating political Islam and increasing the support for secularism.
Although, Islam is still the state religion (so 1972 constitution is not fully restored), secularism is definitely on the march and religious nationalism in retreat. A recent evidence of this came when pro-religion rightist BNP also came out against the political role of religion. Tarique Rehman, the current senior vice chairman and the future leader of BNP, said (See Tarique against Religion-based Politics):
We’ve learned from experience that politics of that kind doesn’t work, it didn’t during Pakistan era... There are many among us who have tried to create political essence and outline based on religion. But invariably they have failed.