This sounds troubling and it's a little disappointing to see comments suggesting "factory resets before travel" or "dual booting". These are not things anyone really wants to have to do.
Also, this issue raises some more questions:
1) It sounds like they might use a device to scan your hardware automatically, potentially opening the door to copying files for permanent record
2) It is a small step from here to install tracking software on your device (as China is doing in some places)