A federal judge ordered ICE to free a Canadian dentist and young father, calling the circumstances of his detention “appalling.”