Sir Ramanujan was a religious brahmin. As universal divinity is one of the core elements of Hinduism, he also perceived god in every process happening around him. He always saw these natural processes as a way of communication between god and human. And to understand this communication, he used mathematics.
Thus every equation he came up with was nothing but an expression of god which he was trying to decipher using mathematics. He saw patterns in this communication and used equations to get closer to god and his creation.
This also helped him to focus his research and identify the important areas of his work. This is very crucial given that he did not have a any formal education but still he was able to come up with equations which were in vogue in that times and the times to come ahead.
Thought of God in this context probably refers to Physics. A mathematical expression is meaningful only when applied to explain the phenomena of physical world.