They were legal then and they met the requirements then. Immigration requirements evolved over the years to respond to conditions present in those times. To say that they aren't legal by today's standards is irrelevant.
It doesn't change the fact immigration is what built this country, so your paragraph "about random people from around the world" and random luck was just a bunch of words with no basis in US history.