I agree with the idea of getting a torque arm. At one point, ebikes.ca were selling some ready made ones but not sure if they still are. I made one out of an old gardening tool and others have adapted old spanners...The dropout problem is quite common, these motors have considerable torque. You were lucky in that the spindle didn't rotate more fully and sever the cables.
It's a good idea to fit a torque arm, locking on the spindle flats and preventing rotation. Here's an example of one on a rear wheel motor spindle:
You can see how the small bolt prevents rotation of the plate which has flats to match the spindle ones. There are various ways these can be made for front forks.
The other thing I'd suggest is to make sure you get a steel fork, not an aluminium one!