The prime minister has condemned Sir Jim Ratcliffe's "offensive and wrong" remarks about immigration.