There are several reasons.
But before I get to these reasons, a distinction has to be made between at least three categories of religious people. The first category I will call the “nominal religious.” This is the vast majority of people who pay “lip service” to the religion. They are simply members of a club. The second group are the “religious practitioners.” They are the priests, rabbis, gurus, monks, etc. The third group are the theologians. This last group are the philosophers of the religion. They know the dogmas and they formulate arguments for their defense.
My concern will be only with those who are “nominally religious” — those whose knowledge of the religion is superficial.
For example, as a nominal Christian I may only know that I am to say that I believe in God. But if I am asked about the nature of God, I may be stymied, and I may even not know that as a Christian I am supposed to say that I believe in the Trinity. [Since belief cannot be a matter of choice, the better formulation is that as a Christian I am obligated to profess, to announce … And profession or announcing of a belief is not the same as actually having a belief.]
Another example. As a nominal Muslim, I may learn to say [i.e., to profess or announce] that there is but one God, Allah, and Muhammed is his prophet. If probed, I may be stymied.
So, the question is why do nominally religious people remain members of a religion?
The first is that people treat religions as sacred cows. Cows (in India) must be allowed to roam as they see fit.
The second is that people do not see religions as a set of beliefs — but as social institutions which bring people together — just as if they were celebratory parties.
The third reason is that people crave communities. That is why people form gangs, join clubs and associations, participate in parades and large gatherings such as sports events and music concerts, and identify with their races and ethnic groups.
The fourth reason is that they rationalize religions as modes of satisfying their emotional needs and hopes.
The fifth reason is that people — as social beings — are reluctant to criticize. They are especially not interested in criticizing a religion. Criticism would alienate them from their religious community. They would be ostracised — or, as with the Amish, they would be shunned.
The sixth reason is that — even if they had the desire to criticize — they do not know how to criticize.
So, in a nut-shell, people do not want to criticize (they have no interest in criticism), and they don’t know how to criticize.
And similar things could be said about membership or identification with political parties and other associations.