Robb will take over in January from Adam Sampson, who left the housing and homelessness charity in April to become the first chief ombudsman at the Office for Legal Complaints.
Robb joined the OTS on a three-year contract in October 2006 from the NCVO, where he was director of public policy.
A spokesman for the OTS said Robb was very highly regarded in the civil service and would have had a great future in it, but had decided that the Shelter job was too good an opportunity to turn down.
In a statement, Robb said Shelter's work was more important than ever. "It has consistently fought and won many battles for some of the most excluded people in our society," he said.
Tony Crook, chair of Shelter, said the charity had been lucky to attract such a strong candidate with "an outstanding combination of knowledge and skills. This will enable him to give strong executive leadership to Shelter at this critical time for housing, in terms of both providing our housing advice and support services and our campaigning for better housing for all."
Angela Smith, Minister for the Third Sector, said Robb had delivered "a tremendous and unprecedented programme of support for the third sector."
She said the OTS would announce Robb's replacement shortly.