The US is the only country that I have passed though where they feel the need to poke around with your baggage that is in transit. (Its on my list of "shithole" countries).
I understand that one needs to go through customs & immigration, even if one is only in transit. But the idea that one needs to hand over one's "diary" is beyond me.