Maybe they kept their faith separate from their work in science?
Not at all, at least not Newton. He was also very big into alchemy.
Reading up on it now, he may not have been too public about his particular beliefs because they would have been very heretical at the time.
He grew up during the Commonwealth Protectorate (He was born in the year the Civil War started, and was eight years old when it ended with the execution of King Charles I) a time when republicanism was considered an excellent thing in England, and puritanism was flourishing, particularly in London and amongst the intelligentsia. But in his early 20s, the monarchy was restored, rendering republicanism (and to a lesser extent, puritanism) highly dangerous ideas.
As a politically as well as intellectually savvy individual, he would have been very adept at not discussing religion or politics in the wrong circles - and simultaneously at not failing to express the 'right' opinions on these subjects when it was required or expected of him.
An astonishing number of people in the late 1660s were declaring publicly and loudly how they had always and implacably hated the Protectorate, Cromwell, and excessive puritanism (while still eschewing any hint of popery) throughout the '40s and '50s. Indeed, if you take the surviving documents from the period as being typical, it is almost impossible to imagine how Cromwell failed to be instantly deposed in 1650, given how much everyone hated him. It's almost as though they were in fact mostly supporters of the Lord Protector, but were smart enough not to say so - and to burn any paperwork that might say otherwise.
The reality is that during his time in power, Cromwell was hugely popular. But finding his former supporters after the restoration was like tring to find a Nazi in Germany in 1946. Everyone knew of others who were devoted to the cause, but nobody would admit to having done so themselves.
This delicate political and theological environment would have been difficult to navigate, and renders all but the most private of papers and diaries from the time highly suspect as sources of information about any person's true beliefs.
Newton was able to be more forthright later in his life, but his experiences as a young man no doubt shaped his thinking. The 1640s in particular were a time of wild and outrageous theological, political, and social ideas, as control completely broke down during the war. Who know what ideas Newton was exposed to before his eighth birthday, when most people form their firmest religious convictions. Those first eight years were a time of theological chaos not seen in England since the end of the Roman period.
It would almost be a shock if Newton had NOT held some seriously strange theological positions.