To see Maxwell and contemporaries trotted out to try to prove some point in the present about these men's dedication without letting them speak for themselves (they can't, they're safely dead) is to me just as much a heresy as claiming that Johann S. Bach would have composed all his works if he had been an atheist, rather than that he took a lot of inspiration (if not most of it) from his deeply religious nature.
It's really not fair to put words in the mouths of men long dead and gone, we can not know of their motivations if they had lived in the present because they didn't so all we can do is see that work within context. So I suggest that we just be grateful for the work they did, whatever their motivations were.
Keep in mind that priest-natural philosopher was a pre-cursor to our current day scientist and recognize that evolution of thinking is pretty much a given taking into account the march of scientific progress (if we can call it progress, I wished that that was more clear cut but it unfortunately isn't always, perhaps in a few thousand years or so we can answer that one with clarity).
So, being religious isn't a primitive flaw in anybodies mind, great or not. But it can be detrimental, especially when it counteracts the truth with great (but ultimately misplaced) authority.