You are correct that when a defendant can't make bail or is convicted of a crime and receives a jail sentence, he/she gets separated from the children. BUT and this is a pretty big but, the defendant does not get to that place until he is accorded due process AND again a big and, there are provisions for visiting. They may be hard for relatives to get to the prisons, which raises another set of problems, but those provisions are in place. Here, first of all, the immigrants were attempting to enter legally as they were going to seek asylum. Trump was supposed to have a border crossing at the border so that they could announce that before they got into the country. He acted in violation of international norms, so a large part of this crises was on him. Also, the immigrants had no due process at all. Just ICE guards taking these kids away with no provision, not just for visiting, but so they could be reunited easily with their families.