It does. But if your a US citizen or are ok to be barred from entering the US for a long time, then you have the option to not unlock.
If you go the US citizen route, be prepared to never get your phone back and many future border crossings to be 4+hr affairs where they confiscate most of your things.
As a US citizen they have to let you in.