Sorry let me clarify. The statute you cite is a criminal statute. Prior to trump, the vast majority immigrants caught attempting to cross the border illegally were put into removal proceedings, an administrative proceeding conducted by an administrative law judge. They were not charged with a crime under Federal law, but simply removed from the country under this process. As they were not charged with a crime, issues of due process are a little different. This process accelerated under Obama because anyone caught at the border would be thrown into proceedings immediately. Prior to that most immigrants caught at the boarder would simply be turned around rather than taken through the administrative proceeding.
Regarding detainment. An ankle monitor is cheaper than having to confine someone. The real reason you confine someone at the border is to discourage them from pursuing an asylum case. If you claim asylum you get a hearing, then a rehearing, then an appeal to the circuit court. This process can continue several times and can take several years. Continuing to pursue your case looks a lot less hopeful when you are looking at the prospect of years in jail awaiting your outcome.