Law is not so simple. There are many layers, from The law itself, to judicial rulings and precedent, followed by enforcement and decisions on how to deal with conflicting situations between all of the above.
I agree, and I consider that to be harmful and bad. It should not be up to law enforcement whether or not they will enforce the law. Anytime they do not, they are unjust and harmful. If there are bad laws, let's get them removed.
in this instance there is an administrative layer right under the law: how the enforcement is organized and how much money is spent on which issue.