I would go a step further and say that society needs some level of crime in order to gain freedoms, not just keep the ones they have. As a thought experiment, imagine you had a machine that would magically prevent anyone who would violate the law from doing so from the moment its activated for the rest of time. Is there any point in all of history that you think would be a good time to activate that machine? Certainly you would want to avoid activating it any time that slavery was legal. Probably be a good idea to skip the world wars era. Civil rights era would be another good time to avoid. The Troubles wouldn't be a great time either I wouldn't think. And if you believe in the benefits of medical usage of various schedule I drugs, I wouldn't recommend turning it on today either.
Sure, a reduction in crime might be a great thing for society, and there's no telling how many lives would be improved if truly bad people were prevented from doing their crimes. But the flip side of that is I can't think of a single point in history where some group or action was criminalized that later turned out to be something that should not have been so. And I don't have faith that we'd make nearly as much progress on things without people willing to break the law and bring those injustices to our attention.