You are so, so frighteningly right.
As long as society allows children to be indoctrinated, this type of arrogant madness will continue.
Sadly, the Church or religion, in all of its many forms, is still revered and seen as primarily a force for good and a source of wisdom and morality.
The reality is different. Religion is about ethics, not morality. Each religion provides a code for conduct and how to behave in life. Each promotes a mythical image or a real or imagined 'divine' or exemplary person or entity. The omnipotence & supposed ultimate goodness of this entity is their justification for whatever they choose to do on Earth. It provides an out for any act or behaviour that cannot be justified by reason.
The story you've offered is, I have no doubt, similar to that of many others - thousands, even millions of others. It is tragic with only one saving grace - that for some, as in your own case, it causes recognition of the opposite of what it intends. However, the informed, considered, reasonable, rational, critical thinkers tend to be in the minority so this appalling fallacy of religions continues to do its damage.
We should not persecute or discriminate against anyone so I don't advocate hostility to the religious. They are indoctrinaterd and can't help themselves.
However, when they impose their conditioned beliefs and behaviours on others, they must be resisted.
I have no more idea than any other human being as to whether a 'god' exists or not. However, I do know that torment, trial, torture, discriminatory codes and other physical, mental, social and morally reprehensible acts or dictates ought not to be tolerated by any sane human being.
The religious 'law' used to justify the horrendous treatment of girls and women by the Taliban is not untypical of the harm produced in the name of 'God'. The denial of a right of a girl or woman to decide what is best for her own health and well-being, in a holistic context that only she can intimately know, is as bad as the travesties of justice perpetrated by such as the Taliban.
Just as I don't know whether a god exists, i don't know whether men have been intentionally responsible for organising societies where females are subjugated in one way or another. Perhaps it has eventuated alongside evolution from times when physical might was an essential for survival and nurturing by those who gave birth assumed to be the natural way of things.
I don't know. I do know that subjugation of girls and women should have no place in any equitable, moral and caring modern society. I do know that until it stops, human beings will not stop hurting one another and there will not be peace and harmony on this planet.