The receipt they give you is secondary - the main point is that there's also a permanent record created on the retailer's systems, sometimes involving a physical copy of all the receipts printed, sometimes a digital record that the retailer cannot alter, but in any case it does matter that you were given a receipt, since even if it goes straight into the waste bin, then it serves a purpose of ensuring that the transaction was properly registered.
You need a record of all transactions for tax purposes. If I give merchant a dollar, they give me a donut, and don't record the transaction, that's a crime - they're not paying sales tax/VAT on that, and also obtaining unrecorded tax that is used to pay "black salaries" in cash without paying the appropriate income & social security taxes.
I am aware of why I need an audit trail in my business. I rarely need the paper receipt handed to my by a cashier for a bottle of water. I put it straight into the waste bin.
If the cashier isn't routinely giving out the paper receipts, how do you ensure that the paper receipts exist in the first place? The assumption is that at least some of the businesses don't want that audit trail. Handing out receipts on request would/could mean that the receipts are only created if requested, and a majority of transactions can stay unregistered.
The ritual of giving a receipt to you (and you putting it straight into the waste bin) visibly demonstrates that the business routinely creates the receipts for all (most?) purchases, it ensures that in the vast majority of cases the receipt actually gets produced, and if a business is routinely not producing these receipts (or having fake info in these receipts) then this would be clearly visible to the general public. This ritual has a certain social value in enforcing tax compliance, so that's why it's required despite the paper cost.
You need a record of all transactions for tax purposes. If I give merchant a dollar, they give me a donut, and don't record the transaction, that's a crime - they're not paying sales tax/VAT on that, and also obtaining unrecorded tax that is used to pay "black salaries" in cash without paying the appropriate income & social security taxes.