The result ended OK for Finland because they exhausted the Soviet offensives in 1944. Phew. Thats why they still exist. It was a terrible gamble to join Barbarossa as it is and the best chance for getting anything out of it was clearly if the Germans could win. They sort of gambled without trying 100%. Really rare that this works.
As for why Stalin should think its OK you help cut the Murmansk railway, but if you help take Leningrad then I'll hold a grudge? It just doesnt make sense, and i stand by that respect was won in 1940 and confirmed in 1944. They didnt have to take their losses in 1944 as in 1940 they proved themselves very different from the Baltic states.
Joining the war in 1940 was madness, but nevertheless a madness confirmed IOTL. The president wanted all of the Kola Peninsula, while Mannerheim went by the policy of taking back what was lost (and a few times some more). If the only option was to go all in (at least until Leningrad and Karelia was taken as it is ITTL), Mannerheim would have to do what his government wanted.
If you look at the Finnish position in 1940 in detail, you will see that Finland was *totally alone*. Together, the Soviets and the Germans could practically blockade all Finnish routes of foreign trade. The British trade policies towards Finland were also practically increasingly hostile. Any trade Finland could do through Petsamo, or with the help of Sweden (who tried to maintain her own neutrality quite forcefully) was not enough to keep the Finns alive. The loss of the Karelian Isthmus removed a lot of the best farmland Finland had, leading to a situation where Finland couldn't feed her people and was unable to get the needed food from abroad.
In 1940 Finland was facing both famine (by late 1941) and a hostile Soviet Union that meddled in its internal affairs, shot down a Finnish civilian airliner, and went on to occupy and annex the Baltic states. Finland sorely needed foreign help, and after the (unrealistic) defensive union with Sweden was shot down in flames, too, there was only one realistic source for food, weapons and support - Nazi Germany.
This is the background of Finland allying with Germany and joining Barbarossa. I don't think it is possible to understand Finland's choices in 1940-41 if you don't understand and appreciate the position where Finland was, and where staying alone, doing nothing to get foreign help, would have been a massively irresponsible thing to do by the Finnish government. It would have risked starvation and eventual Soviet occupation, and possibly becoming a battleground between the USSR and Germany, anyway, like Poland and the Baltic states, without the Finns in a position to do anything to stop this. Better to make unoptimal choices and maintain a measure of control than do "the right thing" and potentially lose all control of your nation's destiny.
Going "all in" with Germany was never the only option. Why? Because even a lukewarm Finland as an ally would tie down Soviet resources, guard a major stretch of front, and relieve the pressure German armies would be under. Finland could deliver a lot of goods Germany needed, above all various wood products and Petsamo nickel. But a Finland that is not an ally, or one that is occupied by the USSR, would give no benefits to Germany. IOTL, Finland could get away with just a limited input because the benefits of Finland as an ally, even a conditional one, heavily outweighed the possibility of Finland being entirely outside German control, or then an area that the Germans would have to invade and occupy by force. If the Finns say "no" to attacking Leningrad, the Germans can well drop the point and settle with lesser participation. They win, comparatively speaking, anyway if Finland is an ally, and stand to lose if it isn't.
As for the Murmansk railway versus Leningrad.... The Murmansk railway was just that, a railway running through some woods. With enough troops and support you can possibly take it and hold it, among with a stretch of northern wilderness. Leningrad, however, was a city of millions. Taking it, and holding it, would take significantly more resources. It would cause significantly more losses. Losses Finland can't afford. And even in the best case, occupying it would make the Finns directly responsible for those millions of Soviet civilians. As Finland
could not feed them (it could not feed itself), and the Nazis
would not feed them (but would let the "sub-humans" starve), the occupation of Leningrad would make Finland directly responsible for the death of countless civilians. Now, I wouldn't want to even try to spin that atrocity to make Stalin or the Western Allies forget it any time soon - by comparison, taking and holding a bit of railway would be a lot more easier to present as going after a legitimate military objective in any case.
I totally agree, although as the Germans looked like they might not win, the distancing policy became more and more reasonable. But why to take the gamble if you dont want to win as they did IOTL: Crazy
A desperate man grasps at any straw to survive. Beggars can't be choosers. You can choose any old saying here to illustrate the Finnish position in 40-41, if it helps you see the decision between the Devil and the deep blue sea Finland was forced to make in those circumstances. Winning might be nice, but it is optional. Surviving, on the other hand, is necessary.