Sweden is — just like Denmark, Austria and Greece — a member of the Schengen treaty.
Furthermore, Sweden is a member state of the European Union.
The first says that there are to be no systematic identity checks when entering Sweden from another Schengen member state (in this case: Denmark). This rule is partly waived due to the large number of migrants that entered last autumn (I don’t know when the ID checks will be lifted again) so upon entering Sweden by rail or road from Copenhagen you will be asked to show ID.
However, the second also grants you freedom of movement, as you are also an EU national. Furthermore, EU treaties clearly state that a national ID card is a valid ID document for crossing EU borders; a passport is not required except for citizens of those countries that do not issue national ID cards (most notably the UK). Sweden has no right to disallow you entering the country except if you pose a national threat of some sort (i.e. intelligence suggests you are a terrorist — very unlikely). Most importantly, Sweden cannot reject you for travelling on a national ID card rather than a passport.
Technically, both could change. The UK example shows how difficult it is to change the second condition. While exiting the Schengen agreement permanently may be easier, you are still entitled to travel to an EU country (such as Ireland, which is non-Schengen) using only your national ID card until the second condition is moot.
On a technicality note, Sweden requires the train operating company to make sure all their travellers have valid documents before letting them board — this is akin to what countries request from airlines. Therefore, before boarding an Øresundståg, you will be asked by train staff to show a valid ID document. The actual border controls will be performed by Swedish police in Hyllie, the first stop after having crossed the Öresund bridge.