Of course it is to do with religion, as you say, Mishap. A religion may start off as a contract between an individual and their god, but it can quickly expand to become a way to impose conformity. Those individuals with a bias toward controlling behaviour codify what is expected of adherents and turn the spiritual experience into a straightjacket of "what God demands of those who follow".
Some religions resist this transformation, some realise that it is happening and try to roll back the accretions, but "the faithful" are vehement in their resistance.
It has been said that the punishment this woman faced/faces is not consistent with true Islamic teaching - but it is consistent with the current face of Islam, and that is the one that is most presented to the world.