The Senate has passed a bill that would require federal authorities to detain migrants accused of theft and violent crimes.