This is the set of tropes that cluster around
Knight Templar: the forces of light in hardcore mode, excessively or otherwise. This mentality is all the way over on the Idealistic side of the
Sliding Scale of Idealism Versus Cynicism — but it has
nothing in common with modern idealism of the
Granola Girl and
Cloudcuckoolander variety.
The
Trope Codifiers are the medieval Matters of Arthur and, especially, Charlemagne (especially the innumberable
fantasy novels and verse epics of the 15th through 17th centuries which were based on, set in, or
vaguely inspired by
the older Carolingian myths). The Arthurian myths have a less militantly idealistic style than the Carolingian ones; the Arthurian work most completely of this style is
Sir Gawain and the Green Knight.
This pattern is rarer outside of Europe (and before the Middle Ages) than within it. The closest analogue to European chivalry was
bushido, the code of the Japanese
Samurai, but the Japanese code emphasized loyalty to one's lord, even to the point of doing evil, while the European one emphasized loyalty to one's conscience, even to the point of treachery.
Of course, that doesn't mean that non-European heroes can't act like this — and it doesn't mean that European heroes always do, either. The Roman-derived tradition of "
My Country, Right or Wrong" was always present in Europe...
See also
Hero Tropes, to an extent. A particular variety of
Idealism Tropes. A civilization that embraces this is a variety of
Martyrdom Culture.
Tropes