Anakin knew he messed up, and he knew he couldn't go back. He just wanted to make it easier for Obi-Wan to let go of him. That's why he yelled, "I hate you!". A clean, fast break is what Obi-Wan needed, so Anakin gave it to him. Vader may have thought he was hurting Obi-Wan with what little he had left, but Anakin knew what it really was. He knew it was goodbye and he had learned that it was best to let go quickly, even if it had taken him years to learn this fact in the smallest percentile.
He only hoped Obi-Wan would take care of whatever was left of Padme and their unborn child. Force knew he couldn't do it himself. With those last three words, Vader buried Anakin deep inside of himself. Vader knew Anakin wasn't gone forever, and he would do what he could to hide that fact from the Emperor.
The galaxy needed a Skywalker, and after Vader tried to mur-, after Padme fell unconscious, who knew what happened to the baby. Vader never killed Anakin, he was protecting him, keeping him just alive enough so that when the time came, Anakin could re-emerge and destroy the Emperor.
Some believe that it was Anakin who saved the galaxy, but it wasn't really. It was Vader.
