The home secretary has faced opposition from within the government over plans to impose new rules on migrant workers already in the UK.