Spain has criticised Israeli Prime Minister Benjamin Netanyahu's government over the Gaza conflict and Israel's attacks on neighbouring Lebanon.