As JPhi1618 mentioned, this functionality centers around CFR 571.114, AKA FMVSS 114. Specifically section 5.2.1 which states:
Except as specified in S5.2.3, the starting system required by S5.1 must prevent key removal when tested according to the procedures in S6, unless the transmission or gear selection control is locked in “park” or becomes locked in “park” as a direct result of key removal.
An important point to understand is that car manufacturers consider the electronic code transmitted from the key-fob to the starting system the digital equivalent of a physical key, so the "removal" of the "key" occurs when the driver presses the button to shut off the car and the code is cleared from the starting system.
This would make it trivially easy to violate the regulation if the car cleared the start code as soon as the key fob was too far away, as it would allow a situation where the "key" can be "removed" before the car is put into park. So to skirt around that regulation, the car simply remains running so the car makers can argue that the "key" cannot be "removed" before the car is put into park. As an aside here, you could argue that it still violates the regulation, as many cars with push button start/stop will stop without the transmission being set to the "park" position when the start/stop button is pressed.
It looks like the last time CFR 571.114 was updated was in 2010, and it hasn't really kept up with this technology. There's a lot of grey area, lawsuits, and it'll probably be a few years before the law and technology fully mature here.
Edited to address @user1663987's comment: If the car engine stopped when the key-fob is moved too far away, then the car mfg would have to implement a system that physically prevents the driver from removing the key-fob from the car unless the system is in park to stay in compliance with the regulation. This would pretty much defeat the "key-less" point, as the best way to "lock" the key-fob in the car while it's running would be to just have a key on it and use a traditional key-based ignition. So in a sense, this behavior is a "desired" interpretation of the regs because it the car mfg doesn't have to kill a desirable selling point for their vehicle.
There is a safety aspect that can be considered, in the event that the key-fob is unexpectedly removed from the vehicle while driving (e.g.: child tosses it out the window), however this isn't something that's currently addressed in the regulations. It's possible that auto makers have looked into this already and found that a vehicle with a key-less ignition that continues running regardless of the proximity of the key-fob is safe, though reports of people leaving their vehicles running by mistake would indicate otherwise. At this point I've wandered into the realm of speculation, so I'll stop here.