This is the result of an intentional policy change. There is zero reason to separate these families. This isn't "how it works," it's how the Trump admin decided to make it work starting in April.
Many of these people are coming here seeking asylum, a legal process, but we've also intentionally shut down portals and refuse to process asylum claims at them, which leads to increased border crossings and then apprehensions.
There is no reason or justification to compare this to domestic jailing, which itself is an often abused and unjust process, given that we have literally decades of experience of not separating families.