I've heard it from Tim Duncan and Extra History, among others, that Russia wanted an alliance in Europe after losing the Crimean war. What happened? Why wouldn't Germany prioritize an allegiance with Russia, with its vast manpower, over the weak and rebellious Austria-Hungary? Thank you, love this subreddit!
Sorry this is so late, but I just noticed the question while scrolling through. Russia did in fact have an alliance with Germany in the latter half of the 19th century. It was the Three Emperors League and included Austria. However, various complications began to arise in the alliance. The crux of the issue was the Balkans and the future of the Ottoman Empire. Russia had interests in the Balkans as did Austria causing tensions. In 1877, Russia launched a war against the Ottomans (again) and nearly captured Istanbul, before being stopped. Regardless, Russia was able to get a highly favorable peace in the Treaty of San Stefano. The treaty, amongst other things, created a large Bulgaria that would be a Russian puppet. This caused fear in Europe and Germany called a congress in 1878 to settle the status of the Balkans.
The result of the Congress was an alteration of the Treaty of San Stefano seeing the Big Bulgaria drastically shrunk. This was primarily the work of Britain (who for most of the 19th century had a Cold War with Russia) and Austria who felt threatened. Russia was naturally incensed and immediately blamed Austria and Germany, who they felt had abandoned them. This was the first blow to the German alliance and it only worsened.
Tensions continued to rise between the Austrians and the Russians throughout the last few decades of the 19th century. Both wanted to annex vast quantities of the Balkans but naturally could not. With rising tensions Bismarck realized it was best to keep Austria and Russia tied in an alliance but in 1884 the alliance was not renewed. Then in 1890, Bismarck was unceremoniously removed from power. With Bismarck out of power nobody in Germany was intelligent or capable enough to keep Russian and Austrian tension from boiling over. With no other alliance, and the promise of foreign investment, Russia gravitated to France. Ultimately, the German Russian alliance failed mostly due to Russian concerns and the removal of Bismarck. Russia felt its interests best served elsewhere and nobody but Bismarck truly understood the need to keep Russia close. A good book to look at for further info, at least from the Russian perspective, is John P. LeDonne's The Russian Empire and the World, 1700-1917: The Geopolitics of Expansion amd Containment.