Why in the world is U.S. Customs and Border Protection hiring foreign nationals?
For the same reason that foreign nationals can join the military, including the Coast Guard that has an overlapping mission: it's a nation of immigrants and for centuries until very recently most Americans readily recognized the value and necessity of recruiting foreign people into various posts.
[dead]
I'm fairly sure you need to at least be a Permanent Resident to get hired, which makes you a US Person (it's a distinct legal definition). Permanent residents are also able to join the military and have been able to do so for a long time. There's enough of them that during the peak of the Iraq War they even held in-country citizenship ceremonies at major bases for people who had filed and completed their citizenship paperwork.