Our disagreements lie in the way we reference "religion". You are talking about modern mainstream religious organizations. I am talking about religious thinking specifically and how that turns off critical thinking skills and conditions people to believe things on feelings and not facts. As for whether it's primary or secondary, does it really matter? You're right that we seem to assign different weights to these things, but I'm lumping them all together since they all feed of of each other. All these flat Eathers for the most part have religion, lack of scientific education, influence of conspiracy theories, and social media echo chambers as part of their toolkit. As far as I can tell, the correlation is significant for all of those things.
(lol)
I'm not even saying it's a cause, though. I'm saying it's just one factor out of many that trains people's brains to believe things without evidence. You can substitute "religion" for anything else like a belief in astrology, numerology, crystals, homeopathy, or whatever else new-age hipster content is trending on TikTok, and my point is still the same.
The only direct cause pathway from religion to flat earth that I can think of, is if a religious person becomes a literalist, and then takes all those passages about the dome, firmament, and corners of the earth as literal fact, which leads them to conclude the earth is flat and 6,000 years old. I don't know how most flat earthers became flat earthers so I can't say that this is THE cause, but it's one probable pathways among many.