Yes, the honorable thing to do would be to turn it in. But then, a lot of people would probably just pick it up and keep it. Who's gonna care? And how can anyone determine who's it was, even if it was turned in? I can just picture them on the intercom, "Would the owner of a lost $10 bill please form a line at the customer service desk?"
But that's getting off the subject. I don't think the issue here is whether it's legal or illegal, since no one is really disputing that a crime was committed. But to use words like "deprived" when referring to a petty theft from a Walmart.
And there are some extenuating circumstances in this case. I know some people just say "the law is the law" and expect us to accept it blindly and mindlessly on that basis, but I think the law also allows for some leeway depending on the circumstances of a given case. If they seem excessively harsh or punitive, then I see no reason they can't be called out on it - since they could have just as easily gone the other way.