As society evolves, the criminal justice system needs to evolve. Consider, for example, that there is now a need for laws to govern how people treat one another online. Fifty years ago this need did not exist, because the internet did not exist.
Consider the evolution that has taken place in society over the last 100 years in terms of the treatment of women in society. While this should never have been the case, women at that time were considered inferior to men and had less rights and protections. As patriarchy has become a thing of the past (at least in some countries), laws have needed to evolve to protect women.
Another example is that when owning cars became common, it became necessary to have more laws concerning drivers' behavior on the roads.