Let's look at the incentives. The picture here is not pretty. There's a big incentive to squeeze budgets, of course, anybody who watches US politics knows you can't just get any money you want, especially when there's 2 dozen another 3-letter agencies competing for the same. There's some incentive to serve citizens better - since once in the country, the citizen can call his congressmen or his local paper and raise hell if he was mistreated, and if bureaucratic middle-management hates something it is being featured in bad press and asked unpleasant question by his superiors. But when it comes to visitors, there's pretty much zero incentive to treat them better. I'm not saying that immediately leads to bad treatment - I am a non-citizen, I crossed US border more than a dozen times last few years and always was treated with courtesy and respect, which I assign to the good nature of the people that worked there. But there always are bad apples, and there's very little that can keep those in check. If the immigration officer mistakenly denies entry or costs a person 5 hours of their life, there are no consequences, ever. So these things are bound to happen, unless some kind of incentive to become better will be found.