Spain’s acting Socialist prime minister Pedro Sanchez lost a parliamentary vote on Thursday to be confirmed in the job, raising the chance of a repeat election.