Back in 1867, Russia had two choices with Alaska.

World in 1857, ten years before the purchase, Alaska is a Russian territory
Most Russian centers of population and economy are located west of the Urals. Treaty of Aigun just gave Russia Manchurian coastline and the ice-free port of Vladivostok in 1858, but it’s already too late. The British are busy settling the Pacific Northwest and will soon challenge Russia for their meager American holdings.
Russian fleet is mainly based in the Baltic, tied down by Denmark and can only emerge from their icy Baltic home into the North Sea, the backyard of the Royal navy. Russian North Sea fleet is at best a pipe dream, their Black sea fleet gone after the disastrous Crimean war, their Pacific fleet lacks for shipyards and ports of any great use.
In 1867 Russia thus has a choice: lose Alaska to the British sometime soon in a war they can’t hope to win; or see if they can lose it to someone else and gain some badly needed foreign currency in return. Understandably they chose the second option. Wouldn’t you?
