Trash cans aren't viable because of shortcomings in our infrastructure; we don't have alleyways. Large apartment buildings use dumpsters or basement trash rooms, but you can't exactly cart those out on to the sidewalk. Street side pickup is the only option barring rebuilding the city, and a garbage man isn't picking up an entire trash can. Having a truck pick up the garbage can would also encounter issues with space and time. That's how we landed on our current... well... "solution".
Also trash cans aren't foolproof. I've encountered more than a few of the critters digging through our refuse, along with a trash panda once or twice. The bags aren't rat proof either; it's not that they rip, but rather the rats chew through.
Complicated problem with a lot of legacy infrastructure debt.