Ok, so you have one short friend and one tall friend. Now you're going to buy 3 bikes so you can have everyone covered? What happens when you get a new friend that doesn't fit your existing bikes?
Then, in that specific instance, I might hesitate to buy a spare vs purchasing a gift for a friend.
Trying to legislate simple statements as if they needed to be universal law, and judging them as failures because you failed to find a a way to do that, does not make the simple statement bad.
In this case, it does, because people vary wildly in heights and bikes aren't easily adjustable to wildly differing heights. The statement was given as advice, and it's bad advice. There are certain types of bikes engineered to be highly adjustable (think bike-share bikes) for different rider sizes, but these aren't the norm for privately-owned bikes.
eMTBs are thousands of dollars a piece. The idea of buying an extra just for friends to ride as general advice is very silly, even ignoring the problems with differing sizes. It's terrible general advice. In the specific situation where you have a lot of disposable income and a very specific friend in mind, sure, sounds fun.