it's kind of like my boss's title is the Judge Advocate General, even though he's also an Admiral.
as an aside, my dad spent 30 years as a uniformed officer of the US Public Health Service (of which the Surgeon General is the head). It was often hard to explain to people how he fit into the military construct since PHS works so closely with the military yet is not really part of them. He was occasionally stationed on military bases, working in military hospitals and part of their rank structure even though as a PHS officer he technically wasn't part of them. It's kind of like the Coast Guard sometimes works closely with the military but technically is not a military service (usually).