There were also Danes who did tell the Germans where to find Jews. You could not trust everybody.
The majority got out of Denmark about at the same time and came to Sweden.
On October 1, 1943, Nazi leader Adolf Hitler ordered Danish Jews to be arrested and deported. Despite great personal risk, the Danish resistance movement, with the assistance of many ordinary Danish citizens, managed to evacuate 7,220 of Denmark's 7,800 Jews, plus 686 non-Jewish spouses, by sea to nearby neutral Sweden.
It was not only less affluent Germans who were against Jews - it was common in all of Europe and for centuries.