(Not sure if this is only an American thing)
It's a fake "virus" that one can catch from the other sex.
Most young boys in elementary school will say you have "cooties" if you are friends with a girl. Girls will say the same to each other if they see one near a guy. Basically it's one of the many ways that they tease each other.
The whole "girls vs. boys" thing.
It's just one of them childhood things... Most of the time the end result is a guy chasing a around girl or vice-versa on the playground.
By the time you get to middle school (grade 6) the whole cootie phase has passed.
Hope you understood that.