Although Locke is popularly known as a founder of empiricism whose works are strongly secular and rational in nature, he was not an atheist. Rather, Locke was a member in good standing of the Church of England and the theological ideas expressed in his works stood somewhere on the spectrum between deism and latitudinarianism.
In many ways, John Locke's theological positions were part of a response to the English Civil War, in which conflicts between the Puritans and members of the High Church party within the Church of England threatened to tear apart English society. The response of Locke, as that of many other writers of his period, was to try to find common ground in the reasonable essentials of religion, leaving details on which people disagreed as matters of individual conscience.
Locke believed first in a distinction between reason and faith. While the dictates of God must be taken on faith, we must use our reason to judge the evidence of whether God actually was the source of certain pronouncements. Locke did not see reason as opposed to faith. In fact, he considered that pure reason, independent of Revelation, supported the existence of God and the role of God as supporting morality. He though that all reasonable people could agree that the existence of a just and good God was an incentive towards commonly agreed upon moral precepts such as not murdering or stealing and acting with charity and benevolence to those suffering misfortunes (orphans, widows, children, the sick and dying).