Spain’s prime minister has become a global progressive icon. But at home, his government is hanging by a thread.