Unfortunately this exact kind of treatment is common at the US border. Search for: denied port of entry nightmare.
e.g. https://news.ycombinator.com/item?id=3545548
I guess when you see scores of people trying to scam the system you get hard nosed about it in time.