Yes, more precisely the town needs to have a medical spa ("Heilbad" in German) [1].
Which can be a medicinal spring, but also other potentially beneficial effects [2], there are towns on the sea, which have the prefix "Seeheilbad" [3], which is purely based on the positive climatic effect of the nearby sea.
And then, this is Germany after all, there is a long list of other boxes that need to be ticked, see [4].