What was the reason that immigrants could be refused to enter the US?

Becuase of their health or them having any sickness