Behind the scenes, the world’s richest person spent a record amount over two years to bend the country’s politics to his will. He couldn’t.