I didn't have to look further than Wikipedia which describes the term's origin as follows:
The adoption of the term into English can be traced from the AmericanI am not aware of anything like this in South Africa - although the article describes similar expressions in Europe (Scandinavian) and it is a pretty cool shared joke for pre-pubescent children to use about the opposite sex.
occupation of the Philippines, in 1898-1945, and before that to British
soldiers' presence in Malaysia. In most Austronesian languages (e.g.
Malaysian and many Philippine languages such as Tagalog) the term for head lice, lice or fleas of any kind, is kuto. Foreign troops had ample opportunity to become familiar with the term and made a slang pluralized form ("cooties") of kuto. How the term subsequently entered the vocabulary of grade school children is unknown.