There are several problems to this defence leaugue.
As already said, Sweden was strongly neutral and isolationist in this era - free of alliances in peace to be neutral in war was the official policy. This needs to change and those that said "either, or" (meaning, either we defend Stockholm from the Karelian Isthmus together with the Finnish army or we do it alone in the suburbs of Stockholm) need to gain political influence and power much earlier.
The invasion of Norway 1940 was a fluke that should not have been possible, but German audacity made it possible. Norway was dependent on her large marchant marine and thus the goodwill of the Royal Navy. The Norwegians thought they only needed friendly relations with Britain and Sweden, and none could invade them. Their army was beyond pathetic in 1940, and that it managed to fight as well as it did was more evidence of the tenacity of the Norwegian soldier than any testimony to the quality of their army. You need to convince Norway that the Soviets or Germany could be any kind of threat to them for them to be interesed in any kind of alliance.
Denmark needs to see a use in an alliance, too. Their policy of disarmament and neutrality towards Germany was seen as the better policy as they could never hope to match Germany.
Finland probably needs to have a less brutal civil war. Perhaps if the Finnish social democrats, like their Swedish brethren, turn anti-communist earlier and stand on the sidelines or even side with the white side in the civil war, making it end much sooner and reprecussions be much milder, that would make Finland much more palatable as an alliance partner to Swedish social democrats. A more staunch Swedish support for Finland during the civil war and for some reason a less infected language issue in Finland in the 20s and 30s should also help make an alliance with Sweden more palatable for the Finnish nationalists.
The Nordic countries would also need common enemies.
How about this:
The 1905 separation between Sweden and Norway goes smoother - it is not started uniliterally by the Norwegians bur rather negotiated, and the two countries remain allies even if they separate politically.
Russia claims that it should occupy Narvik and the Swedish iron ore railroad during ww1 to bring in British supplies (that went through Archangelsk and later Romanov-na-Murman/Murmansk) and have an ice-free port in the North Sea? This causes Norway and Sweden to view Russia with more suspicion and Norway to be a bit less fond of Britain, as Britain did not outright reject the project (to not ruffle Russian feathers). The idea of the Russians wanting Narvik and the connecting railroad gets implanted in the Swedish and Norwegian peoples and governments. Sweden rushes troops north to protect the railroad and re-affirms its alliance with Norway, causing Norwegian support for the alliance to strengthen.
German nationalists decide to boycott the referendum of Schleswig and Holstein, resulting in the Danes winning both Duchies after ww1, which is decried by Germany, and much nationalist posturing is made in Germany about regaining them (that OTL did not happen with Schleswig). At some time in the 20s, parts of the Schwarzer Reichwehr also becomes known, resulting in the Danes fearing the German army and increasing their defences. Also, the Soviets infiltrade or bribe Danish communists to rise on Bornholm in an attempt to gain the island as a naval base to move their positions up during the Soviet Civil war and hopefully block the British fleet that is blockading Petrograd/Leningrad. The rising fails, partially because the Germans land part of the Baltic Division - the Germans try to refuse to leave (not a central German policy, but a decision of the local commander) but are forced to in late 1919 by the Allied Control Commision. Denmark thus fear both Germany and the Soviets.
The Finnish social democrats take the same path as ther Swedish brethren, swearing off revolutionary change in the 1890s and from 1907 working the parliamentary route. They distance themselves from the communists, and once the communists rise 1917, they vocally and firmly decry violence between brothers and the communist armed revolution. Parts of them fight on the white side, but most stand on the sidelines. The civil war is shorter and much less brutal, and the social democrats of Finland are much more palatable to the Finnish elite, allowing them to be part of several governments. The Lappo movement faces much more opposition from the government as the social democrats are part of it and after a small and failed insurrection, they are pretty mcuh neutralised.
The Soviets, either because Trotsky remains or Stalin is more expansionist, take the opportunity during the Schwarzer Reichswehr scandal to invade Estonia, Latvia and Lithuania and move their positions up in the Baltic Sea and start demanding Hangö and the Karelian Isthmus from Finland (to "secure Leningrad") and Petsamo as well. Norway and Sweden see Petsamo as the first step towards Narvik and the iron ore railway and Denmark sees Estonia, Latvia and Lithuania as the first step towards Bornholm. Estonians and Latvians flee in large numbers to Finland and Sweden, including the merchant and military marines of both nations and exile goverments for both nations are established in Sweden despite Soviet demands to turn the people and the naval vessels over.
In 1927, the Kazan cooperation between Germany and the Soviet Union becomes known and the Nordic countries, fearing an aggressive Germano-Soviet Alliance, meet to form an alliance, a customs union and a monterary union. The first one is hammered out pretty quickly. All nations agree to aid each other to the "greatest extent possible" by any nation not in the alliance that suffers agression as determined by the LEague of Nations charter. The defence union will be purely defensive, free of alliances with any other power and otherwise neutral in any conflict.
The customs and monetary unions are harder to get through, but go through in 1930 after the intial effects of the Great Depression.