Yes that's my point. There's a bit more of a process from the Canadian land border than at an airport. At an airport, you'd just be turned around and paying for a flight. At the land border - particularly the border between two countries that don't want you - it's going to take a bit longer because the logistics are more complicated. Also, there might be some kind of investigation, as she has already been staying in the country for several weeks at this point.
However we should be talking about like 3-4 days at most (if that), not 3 weeks.
There is some reason to arrest her. She had already been in the country for 3 weeks doing who knows what, so now that they suspect she was doing something wrong it's worthwhile to investigate.
There's even some justification for making the detention a miserable process, so as to deter others. It's very shitty, and I don't agree with it, but there is at least a rationality about it.
The real kicker is the length of the detention. This isn't in the interests of America, this is only in the interests of the private prisons padding their bill to the American taxpayer. The whole process is shitty, but this last part proves that they are only serving their own interests.