What is the purpose of a serial number? It seems like pretty much everywhere I look, serial numbers can't do the things that it seems they should be able to do.

They can't help people figure out what bike they have.

They can't help at all when recovering a stolen bike, unless you have the bike's number linked to your identity somehow (good luck finding the bike in the first place).

It seems like the only thing they're useful for is warranty fulfillment. You take your bike to the shop, and they check the serial number to make sure that it's the same one you bought from them three months ago. Is this the only intended purpose of a serial number?
If a manufacturer found they had a quality problem with a batch of products (e.g. bikes but equally cameras, phones...) the serial numbers would allow identification of the substandard units. 

If you've recorded the serial number of your bike and a bike thief is caught with bikes in their possession the serial number should help you get it back. This has happened a few times recently around here.