Because not having children IS a danger to society. Any society is made up of people who have this unfortunate tendency to wear out, get old, and die. Leaving society hanging. People need to be replaced. Without those replacements, society collapses.
That's the thinking. Now, to be super clear, I do not agree with this thinking, especially in an absoluteist sense. I'm just saying/defining/laying out that that's what the thinking is.