In A Song of Ice and Fire (and also in the series Game of Thrones), the Night's Watch is a peculiar institution: Regardless of its actual usefulness, it serves a supposedly "vital" function which was originally considered an honorable endeavor by all cultures which partook in the tradition. In other words, the Night's Watch was considered a vital and beneficial institution, and joining the watch was considered a very honorable thing to do. Over time, however, the practical function of the Night's Watch changed from "guarding the realms of men" to being a last resort for criminals, the disinherited and the disgraced. Over time, it gained a stigma among most people, but this stigma failed to gain much traction in one place — namely, in the North. Likewise, although the Watch is pretty much considered by Southerners to serve only as an alternative to death and/or (even greater) disgrace, it seems that some Northerners still willingly join (such as Benjen Stark did).
Visualizing the practical function of the Night's Watch for respective regions compared to their perception of the Night's Watch in a table suggests that the perception of the Night's Watch is correlated with the function of it over time: As all the non-Northern kingdoms used the Watch for ever less-reputable reasons, it begins to be perceived as less reputable as well... but this trend doesn't hold with Northern culture(s) as far as the books seem to portray it/them (albeit that nearly all information provided is from the point of view of noblemen rather than the common folk):
| The North | Elsewhere | |-------------------------------------|-----------------------------| Era | Function | Perception | Function | Perception | --------| -----------------------|------------|--------------|--------------| Earlier | Reputable | Reputable | Reputable | Reputable | Later | Reputable/disreputable | Reputable | Disreputable | Disreputable |
It strikes me as very much... fantasy that such a well-established tradition can exist and "degrade" so much and yet be "tolerated" for so long while one significant group remains an "outlier" in still valuing it. However, G.R.R. Martin takes liberal inspiration from history, so it may be possible that the Night's Watch was inspired by some parts of real-world history... knowingly or otherwise. So, are/were there any real-life institutions/orders/traditions which originally served a highly-respected function to everyone but became stigmatized over time to everyone except for a certain subculture and yet continued to exist for a long time†?
The only (very weak) parallel I can think of is that of monastic orders such as the Benedictines, but it doesn't fit very well because they're not stigmatized but simply entail a career path and lifestyle that not many aspire to following these days. Is there any institution in real-world history which has gone from holding an esteemed function in society to being heavily stigmatized and its function degraded... and yet continued to exist for so long?
†Since everything in A Song of Ice and Fire seems to last for ridiculously long periods of time, the scope of what constitutes a "long time" would of course have to be adjusted for the real world.