Try a thought experiment. Imagine a burglar who, as she breaks and enters homes and steals valuables found there, takes her children along in the car because she can’t get a sitter. Now imagine she is caught in the act by police, and taken to jail.
Would she and her children be separated? Of course they would. Child Protective Services would take the kids into custody while she is jailed, and perhaps beyond if she’s found an unfit parent.
Now consider entering the U.S. illegally, with children. Persons who do so are just as much criminals as are burglars, and as we imprison them, they are separated from their children. How do they deserve less rigorous treatment?
The argument that they’re merely trying to improve their economic situation won’t cut it. After all, that’s also the burglar’s motivation.
In both cases they are attempting to possess something that doesn’t belong to them. In the first case the personal property of others to which she does not have legal title, in the second case American residency to which they are not entitled and which they have not earned.