Legally, of course, and to screen for public health hazards. . .rightfully so, as were my great-grand parents (on both sides).
Illegals don’t care about public health.
I don’t think we screen legal immigrants any more.