I don't think that the show was ever trying to portray Xander as a guy who's never misogynistic and that he got to say sexist things just by accident. If the male characters on the show had been portrayed as either wonderful beacons of perfection or misogynistic bad guys, then Xander/Angel/Spike/Riley/Giles wouldn't be called misogynists/sexist/rapists/abusers/paternalistic/patronizing/epitomes of male privilege and so on, but non-fans/haters of those characters. None of the major male characters is immune to this kind of behavior (though Oz comes the closest) and in some cases their development is the whole point - Spike is a very obvious example since he goes from looking like the worst of the worst when it comes to anti-female violence and misogyny, transforming and reinventing himself and finally becoming someone who comes close to a role model of what a contemporary man's attitude to a strong woman should be (no, I don't think he quite got there, but he certainly made a huge progress). Xander's development might not be so flashy, but I think his development from Nice Guy (TM) to a really nice guy is also pretty important.
I also don't think Warren is really "that other guy" in the way Caleb is - he is far more realistic and recognizable, his background is pretty similar to Xander's and Willow's, and he works so well as a villain in season 6 because it's easy to draw parallels between him and almost any of our heroes (Buffy, Spike and particularly Willow all have major Warren parallels going on, and Xander confronting Warren in that bar feels like Xander confronting someone he almost could have become and was falling back into just a while earlier).
no subject
I also don't think Warren is really "that other guy" in the way Caleb is - he is far more realistic and recognizable, his background is pretty similar to Xander's and Willow's, and he works so well as a villain in season 6 because it's easy to draw parallels between him and almost any of our heroes (Buffy, Spike and particularly Willow all have major Warren parallels going on, and Xander confronting Warren in that bar feels like Xander confronting someone he almost could have become and was falling back into just a while earlier).