Religion, like sexual orientation, is part of a person's identity. The main difference is that religion is more malleable than sexual orientation, at least in theory.
Consider ethnicity. For the purpose of this post I'm going to define "race" as a loosely-defined phenotype (including, for example, skin colour) which we understand to be correlated with having ancestors from some region of the world, and "ethnicity" as a similarly loosely-defined cultural heritage to which a person feels they belong. "Race" is not really malleable, but "ethnicity" is, at least in principle. However, we correctly understand ethnicity as being part of a person's identity. The fact that you can change it is beside the point.
People can and do suffer horrific atrocities because of how they self-identify, even if that self-identification could in principle be altered..