When analyzing a character's decision, consider their internal conflict. Hari Singh's choice wasn't just about money; it was a conflict between his life as a thief and the potential for an educated, respected life that Anil offered him.
Hari Singh returned to Anil because his conscience was pricked by Anil's trust and his own desire for a better life. He realized that the stolen money would soon be spent, but the opportunity to learn how to read and write from Anil would open the door to a respectable and honest future.