Why do we have laws that are not enforced?

It depends on the specific law. Sometimes they are outdated and no one got around to repealing them. Sometimes the police/government decides that enforcement of a specific law is not a huge threat to public safety/welfare, and decides focus enforcement time and money elsewhere. Sometimes the specific law is difficult or expensive to enforce and law enforcement doesn't have the resources to do so.