Sir Gawain adheres to a strict code of knightly behavior whereby he always keeps his promises, honors and obeys his liege lord, and engages in feats of arms to demonstrate his bravery and skill. Yet he also has a reputation for what medieval romances call courtoisie - courtliness, or courtesy. This code of conduct requires him to have perfect manners, give delight to all with his conversation and, in particular, treat ladies with almost worshipful respect.
These two codes - that of knightly conduct and of courtoisie - come into conflict when Lady Bertilak attempts to seduce Gawain. Gawain must find a way to avoid becoming romantically involved with her without seeming rude, or risk behaving dishonorably toward Bertilak, her husband, to whom he owes knightly respect. Complicating matters still further, a third code to which Gawain adheres - that of Christian virtue - values repentance and humility, teaches that a man may be absolved and forgiven for his misdeeds, and, most importantly, that men are all inherently sinful. Part of Gawain’s challenge in Sir Gawain and the Green Knight is to reconcile these three codes of conduct within himself.
Gawain’s decision to withhold the green girdle from Bertilak represents the power of the animal instinct for survival over all of the civilizing codes that attempt to control it.