The optimistic side of me thinks that the relief of the pressure and expectations he put on himself lead to retirement. He failed to medal in 1996 after being a pre-race favorite, and got out-kicked in 2000 after being the heavy favorite for gold. Considering his season was pretty lackluster for him in 2004 despite getting double Gold, he probably saw his era of dominance was over. With the pressure gone after slaying his White Whale afterwinning gold (and another to boot in the 5!) and being out for all of 2005 (thus not the favorite anymore), he could retire on top and in peace knowing he accomplished basically everything there realistically was to do.
My pessimistic side, however thinks he retired to dodge doping. T he testing for EPO, first introduced in 2000, was becoming more sensitive and reliable, thus harder to beat. Coupled with the early stages of development for the Athlete Biological Passport, he probably saw the writing on the wall and knew when to quit as his legacy was already set.