I am a very devout, religious person who believes in the doctrines of the Church of Jesus Christ of Latter-day Saints, and yet I am a physicist. This seems like a contradiction, when it is not.
Let me explain in two different ways.
First, starting from the assumption that my religion is true, we see in its doctrines certain things. One, I am free to do whatever I like, as long as it is good, namely, as long as I am loving God and loving my neighbor. Certainly, understanding God's universe and his mind, as well as growing to be able to manipulate nature to further the purposes of man fall in this category? This is a pretty standard teaching of Christianity in general.
My particular religion teaches that "the glory of God is intelligence." Well, if I desire to gain the glory of God, I need to be intelligent. Since God is intelligent, and logic and reason are his attributes, then certainly I must grow in logic and reasoning ability, and Physics is a great way to do that.
The second way is to build the opposite way: Let's start with the assumption that science is right, and work backwards. The fundamental assumption of science is that the universe is ordered and logically consistent. Why should that be? Science cannot explain its own assumptions. They are, after all assumptions.
Any explanation you can come up with is not testable by science. It is trivial to prove, if you start with the assumption that the universe is ordered and logical, that the universe is ordered and logical.
I believe that a good explanation is that there is a universal, intelligent mind that makes the universe behave the way it does. That mind is also, simultaneously, benevolently interested in our well-being. This explanation is the foundation of my religion.
Note that I have not explained why I am religious in the first place; I am merely showing how to reconcile the two. The question of why one religion over another, or whether religion at all, is an entirely different matter that I do not address here. However, to satisfy your inevitable curiosity, I am religious in my particular faith because I am happier than I otherwise would be. What other explanation could there be?