Since he doesn't suspect that they are going to destroy it, just like the Dark Lord doesn't suspect this, what did he think? Why else would these mysterious hobbits be traveling to such a place, with the Preciousss, if not to destroy it? Gollum is very anxious about Sauron getting it back, but doesn't seem to think further than "they asked me to go there so I will lead them there" and, at some point, "I'll let the big spider eat them and then take the Preciousss back".
Even in the books, he never once questions this or asks them about it (that I can remember, having very recently read them). I find this very strange. Gollum may be odd and obsessed, but he clearly still has the ability to think, scheme and feel various emotions. He is not some kind of complete zombie or madman, even in his rather extreme state when he finds the hobbits close to Mordor.
It's weird to me how Frodo and Sam didn't at least come up with some cover story. Some excuse to go there with the Ring. Anything to make Gollum not guess the truth.
Gollum started following them early on, when they were still the full Fellowship. Did he not hear them talk or wonder why a bunch of people are walking with Frodo and the Ring to increasingly hostile places, further and further to The Enemy?
I can't for the life of me figure out what Gollum think they were doing or what would happen.