“Harlotry” here is a metaphor for idolatry. Their hearts and their eyes were inclined to worship something other than God, just as every other human being has tended to do.
Richard T. Ritenbaugh
Are Humans Good or Evil?
Considering the context, the primary motivation that God had in mind when He gave them this command was to remember the Sabbath. The tassels were something that they wore right on their clothing. It was a part of their everyday dress. They had to look at every time they put their clothes on, every time they took their clothing off, all the while they were on the street, all the while they were doing business. Everyone who was following this command had a tassel, which everybody could look at—to remind them of the commandments of God. But the context indicates that the primary motivation was because this man broke the Sabbath presumptuously (Numbers 15:32-36)!
We all break the Sabbath from time to time, but to do it presumptuously is not something that we want to do. We will break it out of ignorance. We will break it out of weakness. But not very many of us are going to set our minds to break it, as this man apparently did.
So God wanted to remind His people not to be negligent in carrying out their responsibilities before Him. And if these people who were wearing the tassels were aware of the context in which this "tassel commandment" appeared, then they would understand that the primary motivation seems to be the Sabbath.
John W. Ritenbaugh
The Fourth Commandment (Part 4)
Other Forerunner Commentary entries containing Numbers 15:39: