20: Neither shall they shave their heads nor suffer their locks to grow long they shall only trim their heads
Comment: Shaving heads and growing hair long are holy things reserved for taking the Nazarite Vow (Numbers 6:5). Sampson was a life-long Nazarite. That's why he lost his strength after cutting his hair. It broke the vow. It is likely that Samuel and John the baptizer were Nazarites as well. It is probable that Anna the prophetess took the vow of the Nazarite before entering life-long service in the temple. She was respected in the beginning as a Nazarite and later as a prophetess.
23: And they shall teach my people the difference between the holy and profane and cause them to discern between the unclean and the clean
Comment: Some denominations forbid women to cut their hair, but, according to Ezekiel, it is not a sin for women to cut their hair. It is just the opposite. It is a sin for anyone not to cut or trim their hair.
Aside from taking a Nazarite vow, it is sinful (in not recognizing that which is holy) to grow hair long without ever trimming it. Additionally, the Nazarite vow was for both women and men (Numbers 6:2).
Women taking a Nazarite vow are required to shave their heads at the beginning and end of each vow. Both men and women are forbidden to cut their hair during the vow. But, also, both men and women are forbidden to apply the holy practice (of not cutting hair) in a common way.
They are forbidden to apply the holy practice of growing hair without cutting or trimming as a common every-day practice.