You can legislate education, however. And as people become more educated, they become less religious. Win-win!
That is not true in the USA. The more educated you are the more likely you are to be religious. A recent survey states
According to the study, in the 1970s, 51 percent of college-educated whites attended religious services monthly or more, compared to 50 percent of moderately educated whites and 38 percent of the least educated whites. In the 2000s, 46 percent of college-educated whites attended on at least a monthly basis, compared to 37 percent of moderately educated whites and 23 percent of the least educated. The study defines the "least educated" as people without high school degrees.
So the study says that people with more education are more likely to attend church than those with less education.
Tax avoidance is not unethical. It is in fact legally required of publicly held corporations who must operate to the maximum legal advantage of their stockholders.
I think is could be unethical at times. If the company takes from the community (using city services, etc) and does not put back much of anything, it harms the community. In the short term it looks good on the books, but in the long term, I believe it can harm the company, by harming the community. For an example, the students in town have a substandard education because of a lack of revenue. After several years of substandard education the word gets out and the company has trouble filling positions in that town. Maximizing revenue can be short sighted and unethical. Companies should support the cities, states, and countries where they do business. In the long term, it hurts them if they don't support their communities.
This hints at the key problem, which is (or ought to be) as much a quandary for religion itself as for scientific studies of it. Almost all of the questions in Gervais and Norenzayan's study related to religion as a literalist folk tradition — an aspect of lifestyle. This is how it manifests in most cultures, but that barely touches on religion as articulated by its leading intellectuals: for Christianity, say, philosophers such as Thomas Aquinas, David Hume, Immanuel Kant and George Berkeley. The idea that the beliefs of those individuals would have vanished had they been more analytical is, if nothing else, amusing. Gervais and Norenzayan’s findings should help to combat religion as an indolent obstacle to better explanations of the natural world. But it can’t really engage with the rich tradition of religious thought.
There have been a lot of Christian analytical thinkers who rationally think about their faith. Another survey states
According to the study, in the 1970s, 51 percent of college-educated whites attended religious services monthly or more, compared to 50 percent of moderately educated whites and 38 percent of the least educated whites. In the 2000s, 46 percent of college-educated whites attended on at least a monthly basis, compared to 37 percent of moderately educated whites and 23 percent of the least educated. The study defines the "least educated" as people without high school degrees.
So people with more education are more likely to attend church than those with less education. I don't think one would want to argue that getting more education makes you less rational and analytical.
Variables don't; constants aren't.