Because it’s easy to prosecute. You got the suspect dead to rights, with $20 worth of whatever on their person.
And it’s not like those cases even go to trial. I don’t have the exact data on hand, but I’d be seriously surprised if >90% of small-time drug crimes ended up with a plea deal that most of the time doesn’t even involve pleading guilty to a felony.