Could be that he found a grudging respect for the gods. Despite all of HIS power, he kept losing over and over to the other Triforce bearers. Then he lost everything (the Gerudo desert, the kingdom he sought to rule, any chance he had at power etc) when the gods stepped in and flooded Hyrule and everything else. He may have realized that, even with the Triforce, he was powerless compared to them and he needed them to be truly powerful.
Remember, Ganondorf doesn't have to believe in the gods. As a bearer of the Triforce, a relic of the gods, the bulk/majority of his power comes directly from the gods. He KNOWS the gods are there. He knows what their power is capable of. I think his hatred of them is a result of both his origin as the curse of Demise but also, I think it's born of frustration.
Ganondorf first appeared in OoT (unless another game comes out that changes that). He was king of the Gerudo, possibly a powerful magic user even before he got the Triforce of Power, smart enough to get around the fact that HE could not access the Sacred Realm because he couldn't touch the Master Sword and yet, he was beaten...by children. This theme is repeated throughout the other games. Despite his power, his preparations and his ambition, he is constantly beaten. It's possible that the only explanation that makes sense to him is that the gods are against him.
With all of that said, in WW, he had lost everything. It's possible that he was beaten emotionally. He was resigned to the fact that, even if he didn't like it, he needed the gods to accomplish anything.
A good comparison would be a spoiled rich kid. His parents give him everything and never take anything away or punish him. Other people hate him and fight against him. The police arrest him when he breaks the law, the media points out his flaws etc. but his parents just keep bailing him out and giving him whatever he wants. Instead of appreciating what he has and what his parents do for him, he just wants more and wants what his parents don't give him.
Then it happens, Mommy and Daddy stop writing checks. Jr. is on her own for the first time and, for the first time, he realizes how much Mommy and Daddy do for him and how much he needs them.
It's kind of the same with Ganondorf. He might always lose to the other rich kids (Link and Zelda/other Triforce bearers), but the gods did give him a lot. He had a lot of power, he was immortal, he conquered Hyrule at least twice (OoT and TP) before he was overthrown. It wasn't until Mommy and Daddy took everything away (the gods flooded Hyrule and removed the object of his ambition) that he turned to them for help...