Warden is the Norman French half of the pair whose Parisian half is guardian. Both go back to a Frankish word from the Germanic root meaning "to watch, to guard." Norman French kept the initial w; the French of Paris turned it into gu-. English borrowed both, about 1200 and in the early 1300s respectively, and eventually gave them different jobs.
That w-versus-gu- split is one of the most useful patterns in English vocabulary, because it happened repeatedly with the same reliability: warden and guardian, warranty and guarantee, warrant and guarantor, and — with a related sound change — catch and chase, cattle and chattel. Each pair is one word that entered English twice from two dialects of the same language. The sense of a warden as the chief keeper of a prison is recorded by about 1300.
warden (n.) c. 1200, wardein , "guardian, defender, one who guards," from Anglo-French, Old North French wardein , (variants of Old French gardein ), from Frankish *warding- (which became Old French guardenc ), from Proto-Germanic *wardon "to watch, guard" (from suffixed form of PIE root *wer- (3) "perceive, watch out for"). The meaning "chief keeper or governor of a prison" is recorded by c. 1300. A doublet of guardian , for the consonant, see gu- . also from c. 1200