There are through axle hub-motors. Bikes have through axles to save weight, but a hub-motor for one would be heavier. it doesn't make sense to get an expensive lightweight bike, then fit a heavy motor, when you can buy a cheaper heavier bike and fit a lighter motor to get the same power and weight.