Now, because there is also a strong sense of individual freedom, the compromise is that people can have the religion they want but that is to be kept a private matter and the State does not want to hear about religion.
In France there is also a strong anti-communitarist view that all people should be homogeneously French first and foremost instead of belonging to separate 'communities' living in their own bubbles.
All of this has worked well until relatively recently and a 'surge' of the Muslim faith, with some practitioners pushing back on this, e.g. from refusing to comply with absence of religious symbols in schools, all the way to violently trying to prevent free speech (which obviously, or especially, includes the right to criticise and ridicule all religions). This is compounded by cultural clashes, which some see as forcing a change in French culture and the creation of separate communities.