The controversy over the state-based religious freedom laws in Indiana and Arkansas highlights the continuing impact of religion on social and policy issues in this country. The laws were an apparent outgrowth of the feelings of highly religious segments living in those states that they were being marginalized and that they were not being allowed to express their beliefs in their daily lives. According to the Arkansas Democrat-Gazette, Arkansas Rep. Bob Ballinger, one of the supporters of the law in that state, said "...he has worked for years to protect the rights of religious believers."

On the other hand, there was immediate pushback from people who felt that the law would marginalize and violate the rights of another group -- LGBTs. This response to the laws was exemplified by a statement from the CEO of Arkansas-based Wal-Mart, who said, "Today's passage of HB1228 threatens to undermine the spirit of inclusion present throughout the state of Arkansas and does not reflect the values we proudly uphold. For these reasons, we are asking Governor Hutchinson to veto this legislation."

Underlying all of this controversy is the fundamental finding that religiosity is a strong predictor of attitudes about same-sex relationships in the U.S. today. The chart below demonstrates this relationship using aggregated data from four years (2011-2014) of Gallup's May Values and Beliefs surveys, involving more than 4,500 interviews. In those surveys, we ask Americans to say whether they find a long list of items morally acceptable or morally unacceptable. One of those items is "gay and lesbian relations." The table uses self-reported church attendance as the measure of religiosity.

The results show a very strong and generally linear relationship between these two variables. The percentage of Americans saying that gay or lesbian relationships are morally unacceptable is nearly at the two-thirds level -- 65% -- among those who attend church weekly. It drops to 15% among those who never attend church.

At the same time, even among the most religious group, the morally unacceptable sentiment is not universal; about one-third (31%) say that gay and lesbian relationships are morally acceptable. And once we move beyond the "weekly" group, the morally unacceptable percentage drops below the majority line, even among those who attend almost every week or monthly. Clearly, then, the strongest views about the moral unacceptability of gay or lesbian relationships are confined to the most religious segment of American society.

How big is that most religious segment? For the U.S. population as a whole, as measured in these same four surveys conducted each May from 2011 to 2014, 30% of Americans report attending church weekly.

As noted, among this group two-thirds say that gay and lesbian relations are morally unacceptable. Thus, Americans who are both highly religious and who find gay and lesbian relationships to be morally unacceptable comprise about 20% of the overall population.

We don't have the measure of views on gay and lesbian relations broken out by state, but we can look at church attendance by state. In 2014, 45% of Arkansas residents reported attending religious services every week, making Arkansas fifth in the nation on that measure. Although the major focus this week has been on Indiana and its religious freedom law, Indiana's residents are just slightly above average in terms of their self-reported church attendance, with 35% who reported attending weekly in 2014.

So if the same national percentages on the relationship between church attendance and attitudes toward gay and lesbian relations hold in these two states (not necessarily a valid assumption, of course), we would have two-thirds of the highly religious group in Arkansas who find gay and lesbian relations morally unacceptable, or about 30% of that state's adult population. The same extrapolation in Indiana yields a projection of 20% of that state's population who are highly religious and say gay and lesbian relations are morally unacceptable. The group of those who are both highly religious and negative about the morality of same-sex relationships in both states is a clear minority. On the other hand, our latest data show that about 3.7% of Americans identify as lesbian, gay, bisexual or transgender, an even smaller minority (The LGBT population in both Indiana and Arkansas is actually slightly higher than this national average by our estimates). So the battle we have been witnessing this week, in some ways, comes down to two minority groups in essence fighting for what they say are their fundamental rights. The pushback the laws received in Indiana and Arkansas and the subsequent modifications made to the laws in response to that pushback suggests that the LGBT minority and its allied interests won in this particular battle.

It's important to note that the underlying attitudes about same-sex relationships have been changing significantly in recent years.

While about four in 10 Americans found gay and lesbian relations morally acceptable in 2001, that percentage is now up to almost 60%. The morally acceptable and morally unacceptable lines crossed in 2008. This is a remarkable shift in attitudes in a time period of 13 years.

Regardless of the specifics of this particular situation, understanding the relationship between religiosity and views on same-sex relationships is important, because it helps illuminate one of the central underlying fissures in American society today. Religiosity in the U.S. is correlated with a wide variety of partisan and ideological positions, and so it is a substantial part of the hyper partisanship that is currently dictating American politics. Religious beliefs can be very powerful and immutable, and are almost certainly going to continue to be extraordinarily important in the political, ideological and cultural wars ahead.