Hi!
I don't know the exact answer, because I believe that this is just how the Japanese language was formed. But even though kami has the same meaning to both paper and hair, it can mean either depending on the sentence that you use it in. For example, kami as in hair can be used as:
私は髪の毛をきります。
I will cut my hair.
Or kami as in paper, can be used as:
紙に絵を書きます。
I am drawing a picture on paper.
Others will understand what you are saying based on the sentence that you are using it in. Another way to say kami as in hair, is 髪の毛 read as: kami no ke
This is the actual and longer way to say hair in Japanese. Kami is actually a shortened version of kami no ke. So you can say either kami or kami no ke, because others will understand you based on the sentence you use it in.
Hope this helps! Good luck!