In his typical thorough way, Newton delved deep into the writings of early Christians. He must have read nearly everything that had been written during the first three centuries of Christianity. And he couldn't help noticing that the doctrine of the Trinity, a foundation of orthodox Christianity for over a thousand years, was only propounded and made official in the fourth century.
Europe was still suffering the aftershocks of the Protestant Reformation, and England wavered between Catholicism and Anglicanism, the supporters of each demonizing the others as heretics. But both sides accepted the doctrine of the Trinity as a necessary component of Christian faith. Just try to imagine what it would have meant, in this climate, for someone to question such a basic dogma.
As a member of Trinity College, Cambridge, Newton was required to become ordained in the church. This would have meant a public affirmation of the doctrines of the Anglican church, including Trinitarianism. An unmarried man with no family, there was no plausible reason for Newton to avoid ordination. In the late 1660's, Newton began looking for a new job. But then, in 1669, he was appointed to the Lucasian chair of mathematics. Isaac Barrow, Newton's predecessor in this position had sought, and obtained, exclusion from the ordination requirement for the Lucasian professor - an effort in which he had had the support of none other than Newton himself! Newton was thus able to retain his professorship without damage to his conscience.
Newton, secretive as always, wasn't about to trumpet his conclusions to the world. He did, however, write up for himself a paper on "Two Notable Corruptions" of scripture: two passages that, while appearing in the translations used in Europe and England, nevertheless were absent from some of the earliest manuscripts as well as from the writings of the early Christian fathers. One of these, 1 John 5:7, was the crucial passage that announced
For there are three that bear record in heaven, the Father, the Word, and the Holy Ghost: and these three are one.
...the only place in the Bible that seems unambiguously to declare the Trinity. This passage is now recognized by New Testament scholars as an interpolation - a later addition to the text - for essentially the same reasons Newton cited. Most modern translations omit the verse, or at least insert a footnote remarking that it is missing from some early sources.
Newton did show the paper to some close friends, who encouraged him to publish it. But Newton hated the controversies that had arisen over his rather tame publications on optics - there was no chance he would confront the firestorm sure to ensue if he questioned the Trinity!
A few others among his acquaintances probably knew of, and even shared, Newton's Arian views. During his lifetime his heresy was suspected. But, as he never openly declared his views - and later in life even took to supporting churches and making other nods toward conventional piety - no action was taken against him. In contrast, William Whiston, a close friend who did take the dangerous step of going public with his Arianism, was removed from his professorship in 1711.
After his death, Newton's admirers so thoroughly whitewashed his religious beliefs that it was only in the 20th century that they were once again uncovered by historians.