The problem is that Munich itself really doesn't offer anything worth of elevation, the biggest "climb" is 0.5km at 4% (if you extend the radius to Grünwald than you have at least a 0.5km 10% climb). So basically impossible to create an intersting circuit within the city.
And while the Alps are not far, it's still always at least 60-100km to the first mountain range.
So the question is obviously, why not finish in e.g. Garmisch instead? Well the road race is part of a bigger European championship event consisting of multiple sports in Munich (Athletics, climbing, track, BMX, rowing, etc.). So the concept is to bring multiple different sports who on their own wouldn't attract many fans together to create one big event over 1,5 weeks to have a big audience. Therefore the organizers need the race to finish in Munich.
And this works, there are many fans at the track, the climbing, etc. It's just a shame for road cycling that the city and the surroundings itself don't offer an attractive route. And its an even bigger shame because last year was actually really good and had plenty of big names competing, so I feel they missed a chance to not build on that (last years timing right before the WC was also better I think).