Which losses in particular are you referring to? Without any more data provided, I could say it was/is because they nurture baseline grinding game, and they are very good at it, and most of them are natural clay-court players, while Novak isn't so much of it. Paradoxically for the great rallier that he is, there is a point where long rally causes him to fold under frustration and miss first, unlike Murray, who could always make one more shot than the opponent.
He is 73-19 against the Spanish player without counting the matches against Nadal. So he wins 79.3% of the matches.
In his career he has a winning rate of 83.2%. When you don't count Nadal in this case too then he has a winning rate of 84.7%.
So yeah you can say he prefers to play non-Spanish player when you look at the stats. But to be fair Spain has a lot of good players so it's reasonable you don't win so often when you have better ranked opponent.