I suspect that what the salesman actually means is "There's a legal reason why we need you to be in the showroom when you make the purchase" (rather than "It's the law that you must be in the showroom when you make the purchase", which isn't quite the same thing).
The dealer CAN sell you the car when you're not present. Neither he nor you would be infringing any laws. HOWEVER, if he does so, the law on 'distance selling' (i.e. the Consumer Contracts Regulations 2013) then applies, meaning that you'd acquire the same rights as when purchasing goods online (over and above the rights you'd acquire when buying them in a shop).
Importantly, that would mean that you'd have the right to a full refund if you returned the car within 14 days (even if there was absolutely nothing wrong with it).
So anyone wanting to hire a car, but not wishing to pay anything for doing so, could buy the car, use it for a week or two and then hand it back for a full refund. It's easy to understand why the dealer might not be too happy with that!