He was their best spy. The way he worked was to get himself captured, get the information he needed, and escape. He was an expert at escaping and could always find a creative solution.
Because he was such animportant spy to the U.S. - and a hated person to everyone else - if you looked him up you would find he doesn't exist. The CIA never seemed to care that he was completely insane. Maybe that's why he took such great risks to do this and was so good at it.
He wasn't really nuts. If you really got to know him, you could tell it's all an act and that he is completley aware of everything, with a good hold on his senses. But he didn't appear that way to the world nor on paper. Nobody ever got to know him that well anyway. The one person who knew anything about Sam's past was Sam himself and he wasn't about to tell anyone.