A male migrant has avoided jail despite admitting to fraud after he used a female nurse's identity to work in a hospital.