It's stretching the definition of "left wing" to define the EU as such. The last elections were a big shift to the right, and they're terrified of what's to come.
CDU is center.
For Denmark you need to consider the coalition (left, center, right), not just one of the parties.
For both these countries this policy makes sense, for a broad electorate. Denmark is famously strict on immigration, right wing parties from all over Europe go on pilgrimage to it. Poland has the most Ukrainian refugees afaik, and *if* the war escalates, it's their men who are closest to front line.
