Also, in a lot of countries, being a border person is one of the best jobs available -- status, contact with foreigners, and a conscious decision by the government to put a good face forward by picking good people.
I've visited about 100 countries or autonomous regions, and I've never had a bad border experience in any country. The worst thing has just been getting visa in advance vs. visa on arrival, and in the case of Belarus, previously-restrictive policies which were loosened and a lot of people didn't know about it (transit via Minsk airport now doesn't require a visa)
The only places with on-paper bad border controls for US people seem to be otherwise-decent countries which are trying to apply reciprocal pain to US passport holders -- Brazil being the best example.