Some states require that spent cartridge case. Have for some time. If I recall correctly, in the states that require it, the gun shop that receives the shooter and the case is required to send the case and appropriate identifying information to state authorities. The state authorities will in turn digitize the base of the cartridge case and enter it into the Integrated Ballistics Identification System (IBIS). IBIS is a national data base.
When cartridge cases are found at shooting scenes they are sent to a crime laboratory and their headstamps are checked against the data base. IBIS has been in place for about 20 years, and the data base keeps growing. Shooting crimes are quite frequently solved more by information in IBIS than by forensic examination of the actual bullet taken from a body or other place. Examination of the bullet will usually tell what kind of gun fired it, and if the gun is in custody that can be confirmed. The cartridge case can tell which specific gun, and who is owner of record. Then they track down the gun through owners.