Besides the fact that having one on you would be a crime if you are stopped and checked, instead of being handed it back and sent on your way. Using one as a weapon would be 2 crimes instead of 1.
Plus it gives a message… this (carrying around a knife) is unacceptable in our society.
Finally the fact that a law might not be easily enforced is no reason not do have it on the books if the law enphasises what we want our society to be like (I think most agree that running around with big knifes is not something we want).
The point about people dumped into the asylum system and not allowed to do anything but be bored is an important one though. Idle hands are the devil’s play things.