Israeli Prime Minister Benjamin Netanyahu has accused Spain of being hostile towards Israel and acting against its interests.