Here's why he seems to "turn evil" at the end of *The Two Towers*:
* The Ring's Influence: The Ring is a powerful object that corrupts anyone who possesses it. It amplifies existing desires and pushes them to the extreme, making Gollum's obsession with the Ring even more pronounced. The longer he possesses the Ring, the more it controls his thoughts and actions.
* The Temptation of Power: When Frodo is injured and loses the Ring, Gollum is overcome with the temptation to claim it for himself. He sees it as his rightful possession and succumbs to the Ring's allure.
* Betrayal of Trust: Frodo and Sam had put their trust in Gollum, believing he could help them. Gollum's betrayal, even if motivated by the Ring, deeply wounds their trust and makes him appear more villainous.
* The "Other" Takes Over: Gollum's personality is constantly in conflict, with the "good" side (Smeagol) struggling against the "evil" side (Gollum). At the end of *The Two Towers*, the "Gollum" side takes complete control, driven by the Ring's power.
It's important to remember that Gollum is a complex character, a victim of the Ring's influence. His actions are driven by his desperate need to possess the Ring, and while he may have moments of empathy, the Ring ultimately dominates him. He doesn't "turn evil" at the end of *The Two Towers*; he succumbs to the overwhelming power of the Ring's corruption.