>>723065812
Britain started mining the pass between norway and denmark, germany didn't want to become cut off and blockaded like in ww1. They asked the danes and norwegians to please protect their own waters, the former two refused. Raeder pushed hitler really hard for an invasion of the two countries in order to control the sea lane and take the ports in order to have an advantage for their subs. Hitler reluctantly agreed after a while.
People talk a lot today about the moral injustices of invading neutral countries but in ww1 and ww2 it was almost completely irrelevant, every country was fair game when people were jockeying for position and small countries were just hoping to stay out of it. And yes, both sides invaded neutral countries. Even if you ignore the fact that the soviet union was part of the allies britain also invaded places like Iran for an even stupider and nonsensical reason than germany's invasion of scandinavia and the low countries.
In denmark's defense they knew they wouldn't be able to hold against the germans even if they set up all the trenches and defensive lines they wanted, and it's doubtful that british help would change that outcome (as norway proved). If they proclaimed neutrality there was a good possibility germany would ignore them, which is actually what hitler wanted to do in fact, but setting up a futile defense against the germs would almost certainly trigger an armed response since germs couldn't afford a british foothold on their north flank. Choosing not to, strangely enough, was the more sensible option and saved the country a lot of needless destruction.