Most bag tags still aren't RFID-capable (unless you're flying with an airline that has spent 10s of millions and gone all-in on RFID - like Delta). They're old-school barcodes that have to be manually scanned.
Also the cost of delaying an aircraft so that one missing bag makes it is so high that it's unrealistic to expect perfection. Shit happens, bags fall off conveyor belts, tags that weren't put on properly fall off, equipment malfunctions, software malfunctions.
Repatriating a couple of bags and providing compensation is expensive, but not as expensive as delaying hundreds of passengers can be for 20-30 minutes while you find a missing bag - that delay can lead to missed connections (which increases likelihood of mishandled bags), people having to be put up in hotels overnight, aircraft getting later and later throughout the day...
Trust me if airlines could wave a magic wand and get perfection, they would. The reality is they could spend all their profit every single year on it and still not get close. Think of it like a giant logistics operation like UPS or FedEx run, except you're additionally having to try to co-ordinate the route the package takes with a person on a journey, and unlike UPS or FedEx you don't own the infrastructure at most of the airports you fly into. A lot of the times it works fine, but sometimes things go wrong. There's too much wetware involved,