Because it's on Russia's doorstep, was part of Russia for 400 years until 1991, has a large Russian minority, the Russian Black Sea fleet is based in Sevastopol, the Russia-friendly government had just been toppled in a coup backed by the US and Western European powers, and Russia didn't want another NATO member on its doorstep.
I can't see what would possibly lead to a Russian invasion of Denmark.
They can also see the contrast with next-door Russia. The Ukraine is one of the poorest countries in Europe.
The overthrow of the government was effected by armed militias, with a heavy far-right presence (e.g., pictures of Stepan Bandera, the Nazi collaborator who ethnically cleansed Poles from Western Ukraine during WWII). The US government had a hand in picking the successor government - there's even audio of the behind-the-scenes discussions. There was obviously popular support in Western Ukraine for Maidan, but there was also a lot of foreign involvement and the seizure of power itself was violent and unconstitutional.
From Crimea being part of Russia for centuries, having 60% russian ethnicity population, Ukraine government being toppled by nationalists and neo-nazis with US support, etc...
Why would Russia go to war with Denmark, which controls access to the Baltic Sea, control of which has been a major priority for Russian foreign policy for the past 300 years?
In order to gain a direct way to the Atlantic ocean.
They can currently reach it trough the Arctic Ocean and Black Sea -> Mediterranean Sea. But direct way will be nice.
Another reason would be to insert themselves between Scandinavia and Germany.