I agree, sort of.
The human brain will (without extensive training) always find someone to be the enemy. There’s an “us vs. them” mentality hardwired in that needs to be intentionally bypassed. Bigotry piggy-backs onto that.
So, it is an impairment/defect in the sense that it’s an irrational cognitive shortcut that probably helped our distant ancestors survive in a hunter/gatherer lifestyle but does more harm than good in modern times.
However, it’s not a defect, if you consider a defect to be something that is in the final product that wasn’t on the blueprints. The overwhelming majority of humanity has the “us vs. them” defect that serves as the basis for bigotry; if there are any exceptional people who don’t, they’re few and far-between.