If we were designing vehicle categories from scratch, with no inherited mish-mash of poorly thought through legislation, then I believe the sensible thing to do would be to scale it on the basis of potential to cause harm. This is pretty much matched to the kinetic energy of the vehicle, proportional to the product of mass and the speed squared (1/2 mV² for the purists).
Vehicles of light weight and low speed, irrespective of the power of their motors, should be free from regulation, just as bicycles are, as they have little potential for causing death, injury or material damage. As weight and/or speed increases then regulation should increase, both to ensure that safety systems on the vehicle (brakes, steering, tyres etc) are up to the job, but also to ensure that the driver/rider has the skills needed to handle the vehicle safely and that the vehicle carries adequate insurance to compensate those who might suffer death, injury or material damage from it in the event of an accident.
The debate about motor power is, I believe, a red herring, as the power of the motor doesn't have a direct bearing on the magnitude of potential harm a vehicle might cause; at best it's an indirect measure of speed potential. I'd be quite happy to have a speed and weight scaled regulatory system, as long as it was applied sensibly.
Unfortunately things are fouled up by pre-existing legislation in many countries around the world, plus some frankly barking mad bits of new electric bike legislation that have been dreamt up without regard to the true balance of risk. Just to muddy things further, we should remember that our aims, to encourage the use of ebikes, aren't shared by politicians and governments in the main. They will often be more focussed on maintaining tax revenue, so won't want to see tax-paying vehicles swapped for non-tax-paying ebikes...................