Per Ira Wolfman's Do People Grow on Family Trees? Genealogy for Kids and Other Beginners page 57 if there were no infectious diseases on the steamer arriving for Ellis Island, the first and second class passengers were asked questions and given a physical exam in their cabins and those who passed both tests were admitted without having to go to Ellis Island.
There was no information about how class-of-passage made a difference to the earlier Castle Garden arrivals.