I'm pretty sure Apple stores have replacement stock on hand. Anytime I've had to get my phone replaced under AppleCare+, I've been able to make my appointment, walk in, and walk out with a (presumably refurbed) new phone from a box in the back. Heck, if the replacement didn't work in the store, they had even more replacements ready to go.
This is probably the result of Apple being able to afford to keep that kind of inventory on hand in their stores. Plus, Apple doesn't exactly have a lot of models of phones. A carrier like T-Mobile or Verizon would have to keep a frankly excessive number of phones on hand for any immediate warranty replacements. (How many Samsung phones are on the market at any given time?)
On the gripping hand, it's not like smartphones are exactly *large* and would take up a lot of space in the backroom so...
I think it'd be a nice customer service perk (and part of the reason I stick with Apple) but not something that needs to be legislated. Do carriers not keep cheap loaners in stock that you can borrow (with a credit card deposit) until your actual replacement shows up?