Legislating away religion goes against the most basic principles of human rights and freedom of speech/thought (as well as the freedom of people to peacefully assemble to do whatever they want).
However, a more problematic issue is protection of children. Children ought to be protected not only from physical harm, but also from mental harm as well.
The fact is, at least 90% (and probably more) of believers in any religion are so because they have been indoctrinated into it their whole lives, from well before they could think rationally and make informed decisions on what's true and what might not be, based on all possible data and evidence. It is also a very well known fact of psychology that once a person becomes convinced of something, eg. through indoctrination, it's extremely hard for them to start questioning it and thinking about it critically. That's why all religions try to get them as young as possible. No religion (I know of) teaches that "you should wait for your children to become adults before you teach them the religion", but the exact opposite.
To what extent can we limit what parents can teach their children, even if it's proven beyond any reasonable doubt that the teaching is indoctrination at an age when the child cannot make informed decisions on their own? The current answer is "we can't", but should that be such a self-evident fact of life?