Ah. It's not about actually doing something effective--it's just about looking like something is being done.
There is not enough civilian law enforcement trained, equipped, and ready to guard a border.
Actually, there is. It's just horrendously misallocated.
Do we really need troops in Germany guarding the Fulda Gap from invasion by the Soviets?
No, which is why we're moving them to Eastern Europe.
The military stays until civilian law enforcement and National Guard can be ramped up to take over. Military should still offer some assistance after that as necessary.
1. If that's your proposed CONOPS, they will always somehow be "necessary."
2. If you make an army into a border patrol, you will discover that, when a war breaks out, that you will have to send a border patrol to do an army's job.