There were two main reasons for the German invasion of Norway early in World War II. One had to do with military power and the other was more related to supplies that were needed for the German war effort.
One reason to invade Norway was to get naval and air bases and to deny them to the enemy. Germany did not really have any problem with the idea or a neutral Norway. What really worried them was the possibility that the British and French might occupy Norway. This possibility had been discussed by the Allies but they had not actually done anything about it. If the Allies were to occupy Norway, it would make it exceedingly hard for the German navy to get out of the Baltic to the Atlantic. The Germans wanted Norwegian bases to prevent this and to allow their ships and planes easier access to the North Atlantic.
A more important reason to invade Norway had to do with resources. Germany depended heavily on iron ore that came from Sweden. The ore was shipped through Norway because Norway’s port of Narvik was ice-free all year. If the Allies occupied Norway, this conduit for iron ore from neutral Sweden would be broken and Germany’s war effort would be endangered.
These were the main reasons for the German invasion of Norway.