German titles and their usage are pretty interesting. You have the two generally used titles, Herr and Frau, used simply as a title of respect for adults. You have the antiquated Fräulein. Then you have professional titles. In English, if one's occupation includes a professional title, such as doctor or professor, they are simply called "Doctor X" or "Professor Y". The more general (and gendered) titles Mr. and Miss/Ms./Mrs. are eliminated in favor of the professional, gender neutral title. Anyone called "Doctor X" could be male or female.
This is a bit different in German. Instead of eliminating titles, the professional title and the general title are both used. So you would say "Frau Doktor X" or "Herr Professor Y". The gender neutral does not come into play; you can clearly see the sex of each professional by their title. In the case of a female professor, the feminine term "professorin" would be used: "Frau Professorin Z". In this case, the gender distinction is seen twice.
The development of this usage is even more interesting. Historically, both people in a married couple used the same name, with their own gendered title. So, in English, you would have Mr. and Mrs. Bob Smith, even though Mrs. Bob Smith's first name might be Helen. In German, this transfer extended to professional titles. Herr Doktor Müller might have a wife named Birgitte, but she would also be called Frau Doktor Müller. The professional title transferred even though the wife might not be a doctor herself (and I would assume it was barely ever the case that she was). She was simply the wife of the doctor, and her title reflected this.
It seems like this transfer of title could have been class-related. Occupations which have professional titles are generally prestigious in some way, so the person who had an occupation of this type would have been a fairly important person within a given community. So, by extension, the family of an important personage would also have been important; these families would have been the comfortable ones, the high society of a given town. (I am talking about regular everyday people -- let's not bring nobles into this just now.) The Frau Doktor and Frau Bürgermeister would have been important people, simply because professional trades gave a family higher economic status than, say, farming. So, why should they not have a title which reflected that economic status?
Nowadays, this transfer of professional titles is not really done. If a woman is called Frau Doktor X, one can assume that she, not her husband, is the doctor. Still. It seems pretty strange to me that such a title was transferred along with the surname. And would the title be then appended to the entire family? Were the kids Fritz and Anna Doktor Müller? I'm pretty sure this was not the case, but it's a natural extension of this still very strange concept.
Thanks go to izubachi for grammar corrections.