Spain has moved closer to having to call its third election in a year after the country’s acting premier was denied a second term in office.