This argument makes two key mistakes - it misunderstands why people commit crime, and fails to weigh the value we place on deterrence against other aspects we hold important.
Firstly on decision-making: people are not perfect cost-benefit calculators. Often times, their calculus is flawed because they aren’t very good at projecting and imagining their future selves. When we finish an entire box of biscuits we are probably setting our future selves up for a tummy ache, but we either underestimate the probability of that tummy ache or its intensity.
Secondly, people often commit crimes on the basis of necessity. Oftentimes, even when the cost of crime is high, the cost of *not* participating in it might be even higher - starvation, poverty or illness.
As a final point - on deterrence. Stopping crime is important, but we also balance that with respecting the dignity and privacy of citizens. It might be that random searches of people’s homes might stop more crime, but we realise that would be too big of an invasion. Similarly, we might say that making prison too punitive unacceptably flouts criminals’ basic dignity.