It's also frankly really expensive to jail people. So there's a counter force at work also - by imposing mandatory minimums, you swell the jail population which costs the government money - at a rough cost of $422 per prisoner per day.
Further, there are also cases where people have mitigating circumstances, or the punishment doesn't really fit - but with no discretion in sentencing, can result in unduly harsh scenarios - like mandatory minimums for theft and a kid steals a pencil because he's from a dirt poor family and needs one for school.
As far as drugs go -
https://www.acic.gov.au/sites/default/files/2023-03/NWDMP Report 18_1.PDF A lot of people don't realise how prevalent drug use is within our community. If police got very serious and pulled a sudden citywide blitz on many major roads at peak hour on a work day, you'd be dealing with thousands or potentially tens of thousands of detections.
People get really bent out of shape about the weirdest stuff. Society has a drug problem, it's not just Ezra.