I know it's a sort of commonplace in certain circles that Madison (and other Federalists) had sort of absorbed certain Congregationalist Calvinist ideas, particularly a commitment to the idea of "total depravity" -- that human beings are hopelessly enslaved to sin. And so this then is understood to explain his concern about "faction." But I admit I don't understand why one has to believe that humans are irredeemably sinful to think that one should be worried about how to deal with conflict within a polity. It's hard to characterize Locke as Calvinist, but he thinks atheists are not to be trusted as members of a society, since their oaths are not divinely sanctioned and so worthless.
^^^^^ CB: Agree. A historical materialist hypothesis would be that rather than theology Madison was mainly concerned about farmers, mechanics, sailors, "pioneers" ( maybe woment, slaves and Indians) "uniting" against the slavowning and manufacturing bourgeoisie when he put the anti-democratic provisions in the Constitution.
Maybe his concern about atheists was that they had obviously disgarded a main form of mass brainwashing. Did Madison really believe in God ? He was as smart as Jefferson.