There are many stories of US Embassies and Consulates granting visas when they should not have done so. CBP is (properly) a check on that. Could CBP have handled this particular situation better? Probably.
it doesn't mean the check was racially motivated though.