The spectacle of police smashing ballot boxes and firing on protesters has done deep damage to Spain’s credibility