She was trying to commit immigration fraud by coming to work to the US with ESTA. There was evidence. So she could not be let in. She also could not be legally turned around. And deportation takes time.
Of course, it is not desirable to detain such people. And it is especially unfortunate that she was in a for-profit detention facility and suffered mistreatment there. But what is the other option? Let in people with a known history of immigration fraud?
When someone is warned many, many times during the ESTA application process that they may not work in the US during their stay, and they still decide to do so illegally, then sometimes there are consequences to these actions. Even if this person is German.
Of course, it is sad and unfortunate that these things happen. And perhaps laws could change so that small scale offenders are inconvenienced less, but there is a big debate about that with regard to sanctuary cities and decriminalizing petty crime, and it does seem like it’s not the way to go either. Alternatively, the penalty is a deterrent for an offence. Maybe one shouldn’t expect pleasant treatment if they willingly break laws.