Megan McArdle has an excellent short piece on why businesses provide receipts even when customers don't ask for them. She gives a brief interesting history of the introduction of cash registers also. Bottom line: the purpose of cash registers, with loud bells, and of receipts is to prevent employee theft.
A few things to add:
1. That's also one reason the company will often have an offer on the receipt that allows you to get something free. If the receipt were not offered, some customers would ask for it.
2. It's also why a sign by the cash register will often say, "If the employee does not offer you a receipt, you get your purchase for free." Then customers will monitor sales clerks directly. Yes, it will cost the company the occasional zero-revenue purchase, but these will be rare because employees will get in trouble with the boss when the customer goes to the boss to get the item(s) for free.
3. Personal story: A friend of mine, with whom I moved from Canada to the United States to go to graduate school at UCLA, had taken a year off as an undergrad in Canada to run a service station. He bought his Sunoco station when he was 20 or 21. He ran it well and made a lot of money. He ran it so well that Sunoco asked him if they could pay him to write a manual for other service station operators. He turned them down. Why? Because, he said, the most important way to run a service station successfully, besides obvious things like giving good service with a smile, was to guard against employee theft: employees giving free oil to their friends, etc. How do you do that? By being there. Not by being there 8 hours a day but by being there a huge percent of the time that the service station is open.