"A certain prince of the present time, whom it is not well to name" Machiavelli writes, "never does anything but preach peace and good faith, but he is really a great enemy to both, and either of them, had he observed them, would have lost him state or reputation on many occasions." If we were to end the quotation at "enemy to both," the typical reader, versed in some aspect of the moral tradition of the West, would assume a fairly standard denunciation of this prince's hypocrisy and false piety. The fact that this is exactly the opposite of what Machiavelli intends--a thoroughly scandalous kind of approval--is quite possibly why The Prince remains compelling: the book is, simply put, an instruction manual for an armory. It describes the tools of statecraft as a collection of weapons, how they are to be acquired, maintained, and employed, and--nothing else. The maintenance of power is as dispassionate as instructions for operating a DVD player or getting the most from the Atkins diet. In his hands (or, as he recommends, the hands of a prince), religion is a tool like every other: like armies and fortifications and ties to the nobility and attempts to compel the respect of the people. Like the state itself, there is nothing inherently moral or immoral about religion, any more than these inherent qualities might take up residence in a pitchfork or plow. Most notably, Machiavelli approvingly describes religion as a labor-saving device for those princes who are fortunate enough to compel loyalty on religion's behalf:
[Ecclesiastical principalities] are acquired either by ability or fortune; but they are maintained without either, for they are sustained by ancient religious customs, which are so powerful and of such quality, that they keep their princes in power in whatever manner they proceed and live. These princes alone have states without defending them, have subjects without governing them, and their states, not being defended, are not taken from them. [...] Only these principalities, therefore, are secure and happy.
None of this is an explicit denial of religion's God, however: Machiavelli makes clear that these principalities are also maintained by "higher causes, which the human mind cannot attain to." But rather than a statement of reverence, his effectively total divorce of the spiritual and the temporal reminds us of the Epicureans: if there are gods, they clearly don't have anything to do with us.
It would seem that for Machiavelli, religion is located somewhere in a theoretical great chain of utility: it is a tool in the service of the state, the state itself a tool in the hands of a prince, and the prince a tool in the service of history. And it is precisely because of the chilly detachment with which the author describes the institutions in which most men are emotionally so heavily invested that he has seemed, I think, so evil to some. But we do not think this of the historian describing a time ten centuries past, or of a modern scientists describing a colony of ants. We accept the detachment as a necessary tool of putting aside what we wish to be the case for the physical reality of the situations that we observe. We can currently apply this detachment, without reproach, to phenomena as diverse as child socialization, chemical bonds, sociopaths, and climate change--and be published in academic journals. But a functional critique of religion in the service of the state was probably a bit too ahead of Machiavelli's time...and perhaps of ours.
So could Machiavelli have had any orthodox theistic beliefs, despite his analysis of religion as a tool of great potential utility, not despite but because of its potential to deceive? Oddly, I think so. I think he would realize that the uses of religion would exist as they did regardless of its truth--in fact he seems to say exactly this when he claims it "presumptuous and foolish" to assess these higher causes. We have an example of another scientist, certainly a theist, three centuries after Machiavelli, expressing a similar thought: in the words of Benjamin Franklin, "God helps those who help themselves."