I actually don't like the idea of CBP simply substituting its judgment for state department officials about whether someone was a genuine visa applicant. Foreign service officers review all sorts of paperwork, conduct in person interviews, have time to do thorough investigations, know the local conditions, and are infinitely bette suited to determining if this guy is a real software engineer who deserves a visa.
I remember reading a story on another website a few years back about a Filipina who got a fiancee visa to the U.S. but then CBP rejected her on suspicion of her being a domestic worker.
In the absence of some new evidence unknown to embassy officials that jumps out at CBP during an inspection (like a box of resumes and business cards and a wedding dress in the luggage of someone with a tourist visa), I just don't think its their role to override the judgment of whoever issued the visa as much as they seem to do.
If they have a concern about whether the person standing in front of them is the person to whom the visa was issued, then I think that warrants greater scrutiny.
Back to racism issue, a European ordinarily wouldn't have the same incentive to lie about his profession to enter the USA as a Nigerian would, because Nigerians live in more desperate poverty. I don't think it's racist to scrutinize non-immigrant visa holders from impoverished countries,just as I don't think it's racist that people from developed countries can generally enter the USA visa free while people from undeveloped countries don't.
People from undeveloped countries have higher overstay rates. They also happen to have darker skin.