Pedro Sanchez said the two countries had used the crisis to criticize Madrid due to dissatisfaction with its position on the wars in Ukraine and Gaza.