Tolkien never stated all elves have long hair. He only described the length of hair on certain elves. It is just a general fantasy trope that Elves have to have long hair. Tolkien even had elves with beards (when they entered their "third cycle" or the few others that aged that way earlier). Jackson also helped the "All elves have long hair" things.