Knowledge and privilege have different spellings mostly by just serendipity and the vagaries of language drift and variation. Sometimes in language, thatโs just way things are. An obsolete valid spelling of โprivilegeโ is in fact โpriviledge.โ
These two words come from much different places, though. โPrivilegeโ is from Latin by way of Old French while โknowledgeโ is from Old/Middle English by way of Old High German. This divergent linguistic path might have some influence because โprivilegeโ means basically โprivate lawโ and we spell anything to do with that cognate โleg-โ as found in โlegalโ and โlegislate.โ This probably helped to fix that stem it in the word โprivilege.โ
The above is just my speculation. Unlike most etymologists on the internet, I will admit it is such because I donโt have the time nor inclination to do all the research thatโd be necessary to attempt to determine that with any degree of certainty.