Clever Tech
The RemLok technology deals with the 'excess' hair by cutting it off when it deploys (mechanically, by heat or something more exotic). Ruins your hairstyle but saves your life. I think most folks would be happy with that.

Hair in the 34th century is 'Smart', perhaps with the ability to shrink/grow, change colour and consistency and self-clean at whim. It can be adjusted for the social occasion or situation required. After all, "You're worth it."
Remloks themselves are part of a wide variety of devices with similar functions but which work in a variety of ways from the basic 'mask', through to the 'helmet' to the full 'cocoon'. What you use depends on the travelling situation you are in. A pilot in a fighter ship is like to use a different device to a freighter pilot, the same applies to regular and occasional passengers who prefer to wear their own clothes rather than the ubiquitous flight suits.
In short, there's plenty of scope for long hair to be common in the ED universe... IMHO. I suspect glamour, style and fashion will always find a way.
Cheers,
Drew.