I don't know how true this is but I just found a ref that answered the question on another forum. It makes sense why there seems to be confusion.
"High school soccer, in their infinite wisdom, has declared that knots, such as those required to tie a bandana, pose a serious threat to player safety and has outlawed them"
Player equipment falls under Rule 4. The Referee you talked to was correct when talking about bandanas. A bandana worn on the head is considered adornment (see Art. 2 below) so it does not matter if there is a knot or it is held in place somehow without a knot. In Situation 4.2.2, it does say “may be dangerous.” The “may be dangerous” falls under the realm of “in the opinion of the Referee” which is listed in Art 1. I have never had a HS player try to use a bandana as a hair control device. I wouldn’t make a player take the above Nike headband, aka hair control device, off because in the opinion of the Referee, me, it is a hair control device and not dangerous. Once again, referees need to use common sense. HS has some crazy Rules that the LOTG do not have.
Rule 4 Section 2 Other Equipment
ART. 1 . . . Illegal equipment shall not be worn by any player. This applies to any equipment which, in the opinion of the referee, is dangerous or confusing. Types of equipment which are illegal include, but are not limited to, the following:
a. projecting metal or other hard plates, or projections on clothing or person;
b. head, arm, thigh or hip pads containing sole leather, fiber, metal or any unyielding materials;
c. hard and unyielding items (guards, casts, braces, etc.) on the hand, wrist, forearm, elbow, upper arm or shoulder unless covered, and must be padded with a closed-cell, slow-recovery foam padding no less than ½-inch thick.
d. shinguards which have exposed sharp edges or have been altered;
e. spectacle guards;
f. knee braces which are altered from the manufacturer’s original design/production. Knee braces that are unaltered are legal and do not require any additional padding;
g. ankle braces which are altered from the manufacturer’s original design/production. Non-metal ankle braces that are unaltered are legal and may be worn outside a sock. Ankle braces of metal or unyielding material that are unaltered are legal if covered by a sock.
h. helmets, hats, caps or visors. See goalkeeper exceptions.
ART. 2 . . . Hair control devices may be worn if made of soft material and not for adornment.
ART. 3 . . . Sweatbands may be worn on the head or wrist if made of soft material.
*4.2.2 SITUATION A: During pregame warm-up, the referee observes that (a) A2 is wearing a rolled bandanna tied around his/her head; (b) A3 is wearing a bandanna that completely covers his/her head; (c) A4 is wearing a red headband. RULING: Illegal in (a) and (b) because the bandannas are considered adornment and any knotted device
may be dangerous. Legal in (c) if worn to control the player’s hair or prevent sweat on the face.