Both times they didn't have enough staff to man the separate customs desk, and ran us through a general customs hall.
I prefer via Dubai, Hong Kong, or Shanghai. Border control officers there, while still clearly doing their job meticulously, manage to be polite as well.
The idea is that you "enter the country" when going out from the main part of the airport, but you can go from any arriving flight to any departing flight without doing so, and most of the facilities - shops, waiting rooms, etc - are 'inside the zone' as well.
When I was living in South America I met hundreds of backpackers from all over the world that were forced to go through the US on their way South. Many of them had hilarious, stupid and scary stories of how customs treated them when they only had a ~2 hour layover and had no interest in the US what-so-ever. They all vowed to never fly through the US again, even though it will result in higher flight costs.
https://news.ycombinator.com/item?id=6566274
At the time they didn't appear to be siphoning off folks for hand-luggage special treatment, though it wouldn't surprise me if they did.
Customs is a different story, and I'm not sure how that works in this case.
The US is not one of those countries. When connecting between two other countries via the US, a passenger must clear US Customs, then US TSA security procedures before being permitted to board the second flight.
Same goes for traffic violations or pretty much anything that deals with the police or customs in any way.
I'm guessing that this wouldn't be the case for someone whose name is on a list somewhere or someone actually caught smuggling something(might work but would definitely set you back more). But at least in my(and friends') experience, it's never been a problem specifically because of the corruption. Police and customs people are not robots following orders from on high, they're robots who'll bother you to no end until you pay them and will leave you alone and might invite you over to a cup of coffee once you do.