The credit reporting agencies keep track, along with Social Security Administration.
As an example: Bobby dies at the ripe old age of 75. Bobby's surviving spouse Susan tells all her creditors that Bobby died, and tells the Social Security Agency as well. That way Bobby's name gets removed from the bank account, his credit card gets cancelled, etc.
At the same time, every bank account or lender also sends a report to the credit agencies (Experian, Equifax, and Trans Union) telling them Bobby died. Now Bobby's social security number is permanently flagged on the creditor database as deceased. Now, if anyone pulls his credit, there are about 3 different fraud warnings and the bank/lender that generated the report goes into full "what the fuck" mode.
Deceased SSNs are not useable for credit in the way OP would want. If someone isn't actually dead, they get to fight with everybody to fix it and it's a major pain in the ass for a few weeks or possibly months.