Foreign criminals will be deported from the UK immediately after they are sentenced, the justice secretary has said.