Someone asked me about Leviticus 19:27
"You shall not round the side of your head, nor mar the corners of your beard."
In this video I give the answer. The Israelites were directed by Our Creator not to cut their side locks or trim their beard because some of the pagan nations around them at the time practiced cutting their beards in a certain fashion, doing so in connection with the worship of their gods. (Jer. 9:26; 25:23)
If an Israelite adopted the same style, observers might well take it to be a symbol of his religious beliefs, signifying that he upheld pagan worship. Obediently, God's people avoided this style of grooming or personal decoration. So it is appropriate to avoid decorations that would link a person with idolatrous worship.
It was a cultic practice, which some pagan deities looked like a devil goat and Our Creator didn't want His people to resemble a devil goat deity.
It was also common for the pagans to cut or shave the sides of their heads. Same point as with the beard would apply.