When European, at first Christian and then secular colonial powers run rampant over your culture and people for 100+ years, and demonize your local majority religion as barbaric for almost as long, practicing that religion becomes an act of anti-colonial resistance in and of itself. A way of rejecting outsiders' attempts to define "correct" beliefs and morality on their own terms.
Then there's also the element of practicality. At least in Palestine and Lebanon, a lot of the secular leftist anti-colonial movements have been hollowed out, smothered and/or discredited over the past several decades, leaving more religious groups like Hamas and Hezb Allah as really the only resistance-capable game in town.
Also also, there's a social element to it. Class differences can sometimes feel abstract, and religion, like race or narionality, offers a way to cut through that abstraction. A clear way of differentiating colonized in-group from colonizer out-group.