Succession in Catalonia and unpopular austerity measures were not enough to bring down the Spanish prime minister, but a corruption scandal has dragged the political survivor from office.